ShopWindow Search Modes v3

From Wiki

Jump to: navigation, search



The follow are a list of search modes to be used when calling functions within the ProductServe API.


Version 3 of the ProductServe API reintroduces the parameter ‘sMode’. This parameter allows the user of the API to select which mode they would like to complete their search in. There are reasons both for and against each mode and these should be chosen with care. When changing search modes you can in turn speed up or slow down your search response times.

This table orders the modes by approximate speed:

Note: All speeds will vary depending on the query being run and operators (if any) used.

Fastest all
... phrase
... boolean
... extended
Slowest any

The following outlines the search modes and explains how to use each one correctly.

sMode = phrase

Match your query as a phrase. This mode requires a perfect match.

sMode = all

Matches all query words. This is the default mode and will be applied when no mode is passed in getProductList calls. It should be noted that any single words with no operators or other characters will be processed as ‘all’ even if a different mode is requested. This is for performance reasons.

sMode = any

Matches any of the query words. When using sort mode any, your query response times will increase dramatically.

sMode = boolean

Match your query as a Boolean expression. This mode runs slower than other modes but this is entirely dependent on the operators used.

The Boolean operators available are as follows:

  • Explicit operator AND:
hello & world
  • Operator OR:
hello | world
  • Operator NOT:
hello –world
hello !world
  • Grouping:
( hello world )

Example: if required cat but not dog OR cat but not mouse you can do:

( cat –dog ) | ( cat –mouse )

When using quotes; "hello world" implies implicit AND, therefore "hello world" means "hello & world".

The OR operator precedence is higher than AND, so "looking for cat | dog | mouse" means "looking for ( cat | dog | mouse )" and not "(looking for cat) | dog | mouse".

Note: queries such as "-dog" cannot be evaluated. This is for both technical and performance reasons. Allowing such a query would take a long time to return responses.

sMode = extended

Matches the query as an expression in the search engines internal query language. This mode is slower than using boolean or all but can often be useful to perform more complex queries.

The following special operators can be used in extended mode:

  • Operator OR:
hello | world
  • Operator NOT:
hello –world
hello !world
  • Field search operator

An ability to search on products' fields. Currently available fields are:


Search for a product that has the 'fantastic' keyword in its description:

@description fantastic

Search for a product that has the 'cat' keyword in its name and the 'fantastic' keyword in its description:

@description fantastic @product_name cat
  • Phrase search operator
"hello world"
  • Proximity search operator
"hello world"~10
  • Quorum matching operator
"the world is a wonderful place"/3

As with Boolean operators, "hello world" implicitly implies AND, the OR operator also takes precedence.

Proximity distance is specified in words, adjusted for word count. This also applies to words within quotes. For example, "cat dog mouse"~8 query means that there must be less than an 8-word span which contains all 3 words. So "CAT aaa bbb ccc DOG eee fff MOUSE" will not match this query, because this span is exactly 8 words long.

Quorum matching operator introduces a kind of fuzzy matching. It will only match those documents that pass a given threshold of given words. The example "the world is a wonderful place"/3 will match all documents that have at least 3 of the 6 specified words.

Note: Negation (NOT) is only allowed on the top level and not within brackets (i.e. groups). This is to ensure rankings are as effective as possible.


Due to new European legislation regarding how websites store information about you, AWIN is updating its privacy policy. You can see the new version of our policy here. If you would like to see the information we capture on this website, please click here for further details. In order to accept cookies on this site please click the 'I ACCEPT' button