Table of Contents | ||
---|---|---|
|
Free Text Search
...
The free text searches work with the ES simple query string syntax. Here are the key points of the syntax.
+
signifies AND operation. By default, it does an OR query on all the words/tokens provided. To do an AND query instead put a + between the words. For example, to search for items matching bothstore
andnorske
the query can bestore + norske
.|
signifies OR operation. To search for something both using AND and OR queries+
and|
both operators can be used. For example, to search for items havingden
ANDnorsk
ORstore
ANDnorsk
the query can beden | store + norsk
.-
negates a single token. To search for something excluding one or multiple words/tokens this operator can be put in front of that word/token. For example, to search for items havingden
ANDstore
but NOTnorsk
the query can beden | store - norsk
."
wraps a number of tokens to signify a phrase for searching. To group some words/tokens to signify a phrase those words/tokens can be surrounded with double quotes"
. For example, to search for items havingden store
the query can be"den store"
.*
at the end of a term signifies a prefix query. For example, to match all the items having words that start withnorsk
the query can benorsk*
.(
and)
signify precedence. Operators can be grouped using brackets to control their precedence. For example, search for items havingden
ANDstore
ORnorsk
the query can beden + (store | norsk)
.~N
after a word signifies edit distance (fuzziness). When the exact word is not known this operator can be used so ES can guess the word with the provided edit distance. For example, ifsto~2
is provided it will try to create/edit/replace 2 characters ofsto
to make some words (store, test, etc.) and match.