Query Match
The Query Match attribute rewards products whose own name contains the words the shopper searched for. It is the attribute that keeps search results on topic.
Available for: Search recipes (Search Re-ranking).
Why it matters
Section titled “Why it matters”Shopify decides which products match a search, and it matches more than titles: tags, descriptions, SKUs and other fields count too. A search for a product name can therefore return accessories, refills or bundles that only mention it.
In a Dynasort search recipe, the order of those matches comes from your recipe’s attributes. Shopify’s own relevance is used only as a tie-breaker, when products score the same. That is what lets your best sellers rise, but it also means a popular accessory can outrank the product the shopper actually searched for. Query Match is the signal that says which results really are what the shopper typed.
How it works
Section titled “How it works”The query is split into words of two or more characters. For each word:
- 1 if the word starts a word in the product title
- 0.5 if it is not in the title but starts a word in the product type
- 0 otherwise
The product’s score is the average across the query’s words, from 0 to 1, and it earns that share of the attribute’s point weight. A two-word query where both words are in the title earns the full weight; one word in the title and the other nowhere earns half.
Matching details:
- Start of a word. “lighter” matches “Lighters” and “Lighter Case”, but not “Highlighter”.
- Plurals. A trailing “s” is dropped from query words longer than three letters (except words ending in “ss”), so “cones” matches “Cone”.
- Case and punctuation are ignored.
Recommended weight
Section titled “Recommended weight”Give Query Match around 100 points in your search recipe. At that weight it outweighs most behaviour attributes, so products that match the query rank above products that only mention it somewhere. Among products that match equally well, your other attributes (sales, conversion rate, inventory and so on) decide the order.
Use Preview re-ranking in the search recipe editor to try a few of your store’s common searches and adjust the weight until the top results look right.
- Query Match is offered only in search recipes, since it needs the shopper’s query to score against.
- It reads the product title and product type only. If your titles are short and the deciding word lives in the product type, the half credit still lifts those products above unrelated matches.
Frequently asked questions
What does the Query Match attribute do?
It scores how much of the shopper's search query appears in a product's own name. Each query word that starts a word in the product title counts fully, a word found only in the product type counts half, and the score is the average over the query's words.
Why do search recipes need Query Match?
Shopify matches a query against tags, descriptions, SKUs and other fields as well as titles, so a search can return accessories and loosely related products alongside the products the shopper meant. In a Dynasort search recipe, Shopify's relevance is only a tie-breaker, so without Query Match a best-selling accessory can outrank the product that was searched for.
What weight should Query Match have?
Around 100 points in a search recipe, so it outweighs most behaviour attributes and results stay on topic. Sales, conversion and the other attributes then decide the order among products that match the query equally well.
Does a plural search match a singular title?
Yes. A trailing s is dropped from query words, so a search for lighters matches a title with Lighter. Matching is on the start of a word, so a search for lighter also matches Lighters.
Where is Query Match available?
In search recipes only, since it needs the shopper's query to score against.