The search bar is a location on your store that allows visitors to search the site. Users enter a query which is submitted to a Web search engine server-side script, where an index database is queried for entries that contain one or more of the user's keyword research.

How does the search in your store actually works?

The number of all products is divided by the number of matches of the search term. 

Ex: In your product catalog you have 10 products. The user is looking for the expression "red t-shirt". The search is performed on the word "red" and the word "t-shirt" and the search result is 3 matches. Their sum of results is logarithmic to the total number of products. 10/3, the result found is multiplied by the sum of the matches for each product.

Ex: For the word "red" we have two matches, and for the word "t-shirt" we have one match. The matches for the words are added = 3, then multiplied by the result of the logarithm of degree 2.   

How sorting search results works

First in the results are the products that exactly match the search term. Second will be those who have more matches of each word of the expression, etc.