Search API Syntax
Wildcards
Suffix
*
Use an asterisk to indicate that any character, and any length of characters, is valid for this search.
Example | Would Match | Would NOT Match |
---|---|---|
defen*e | defense, defence | defenes, defecen |
provid* | provide, providing | provied, prove |
Fuzzy Matching
Suffix
~#
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.
Example | Would Match | Would NOT Match |
---|---|---|
defense~1 | defense, defence, defenes | defenees, deference |
dfeense~3 | defense, defence, defenes | defending |
Boost
Suffix
^#
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.
Example | Explanation |
---|---|
provide defence^5 | defence is 5x more important than provide. |
provide defence^2 establish^4 | defence is twice as important as provide, and establish is twice as important as defence |
Presence
Prefix
+ / -
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.
Example | Explanation |
---|---|
provide +defence | provide is optional, but defence must be present |
provide +defence -establish | provide is optional, but defence must be present, and establish cannot be present |
Specific Field
Prefix
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".
Example | Explanation |
---|---|
title:article | Search for article, but only in the title |
+title:article provide | Search for provide everywhere, so long as the title contains article. (This also uses presence) |