Docs / Search API / Syntax

Sign In / Up

Search API Syntax

*

Use an asterisk to indicate that any character, and any length of characters, is valid for this search.

ExampleWould MatchWould NOT Match
defen*edefense, defencedefenes, defecen
provid*provide, providingprovied, prove

~#

Use a tilde plus a number to indicate that you want fuzzy matching or "Edit Distance" to be valid. The number indicates the number of characters that can be transposed or changed to find a valid result.

ExampleWould MatchWould NOT Match
defense~1defense, defence, defenesdefenees, deference
dfeense~3defense, defence, defenesdefending

^#

Use a hat plus a number to indicate how much more important a particular search term is compared to the others, with a base of 1.

ExampleExplanation
provide defence^5defence is 5x more important than provide.
provide defence^2 establish^4defence is twice as important as provide, and establish is twice as important as defence

+ / -

By default, all search terms are optional. Use a plus to indicate that a term is REQUIRED to be in the result, or a minus to indicate that the term is to be PROHIBITED from being in the result.

ExampleExplanation
provide +defenceprovide is optional, but defence must be present
provide +defence -establishprovide is optional, but defence must be present, and establish cannot be present

field:

By default, all fields are searched. Use a field name plus a colon to indicate that a term is only to be considered if it is present in a single field. The following examples are based on fields named "title" and "text".

ExampleExplanation
title:articleSearch for article, but only in the title
+title:article provideSearch for provide everywhere, so long as the title contains article. (This also uses presence)