UpStart Commerce Search

Query Algebra

14min

There are multiple query rules you can use to build up any desired condition. Based on this algebra of rules, the search will decide if the query is matching - and thus triggering some action - or not.

Following are a few examples of the query rules algebra to learn about various types and their usage.

Always

JS


The query always matches.

Never

JS


The query never matches.

Match in Specific Field

JS


Query matches if it contains field query on manufacturerName. e.g.: “tshirt && manufacturerName:hugoboss”

Match with Specific Value

JS


Query matches if it contains field siteId with a precise value of “1234”. e.g.: “tshirt && siteId:1234”

Match if Query Present in Any Field

JS


Query matches if there is the term “iphone” in any place. e.g.: “name:iphone”

Match without Specified Field Name

JS


Query matches if there is term “iphone”, but only when specified without the field name. e.g.: “iphone || name: mac”

Match with Either Fields

JS


Query matches if there is the term “iphone” in either manufacturerName or name fields. e.g.: “mac || name: iphone”

Match for Any Field

JS


Query matches if part of the query term, in any field, is a “computer”. e.g.: “bestcomputer”

Match without Specified Fields

JS


Query matches if part of a query term is a “computer”, but only for terms without fields specified.

Match with Specified Field

JS


Query matches if part of a query term is a “computer”, but only for fields manufacturerName and name.

Match if Present in Any Field

JS


Query matches if it doesn’t contain the value “tshirt” in any of its fields. e.g.: “tshirts”. e.g.: “computer“

Match with Any Field with Multiple Queries

JS


Query matches if it has the term “iphone” in any field or if part of the query contains “apple”.

JS


Query matches if it has the term “iphone” in any field and if the manufacturerName query contains “apple”.