Search Examples
- 1 Free Text Search
- 1.1 + signifies AND operation
- 1.2 | signifies OR operation
- 1.3 - negates a single token
- 1.4 " wraps a number of tokens to signify a phrase for searching
- 1.5 * at the end of a term signifies a prefix query
- 1.6 ( and ) signify precedence
- 1.7 ~N after a word signifies edit distance (fuzziness)
- 1.8 Complex Example
- 2 Basic Search
- 2.1 File Search
- 2.2 Member File Search
- 3 Advanced Search
- 3.1 Example 1
- 3.2 Example 2
- 3.3 Example 3
- 3.4 File Search Example
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 both store
and norske
the query can be store + 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 having den
AND norsk
OR store
AND norsk
the query can be den | 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 having den
AND store
but NOT norsk
the query can be den | 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 having den 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 with norsk
the query can be norsk*
.
(
and )
signify precedence
Operators can be grouped using brackets to control their precedence. For example, search for items having den
AND store
OR norsk
the query can be den + (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, if sto~2
is provided it will try to create/edit/replace 2 characters of sto
to make some words (store, test, etc.) and match.
Complex Example
Find items having den
AND norsk
(prefix) OR sto
(with edit distance 2) AND not having norsk
(prefix) OR the phrase den norsk
. The query can be as follows
(den + norsk*) | (sto~2 + -norsk*) | "den norsk"
Basic Search
File Search
Member File Search
Â
Advanced Search
Example 1
Where navn contains Oslo
AND Bunnmateriale is Elfenben
AND (Fysusk tilstand is God
OR Fargebilde is yes
).
Example 2
Where (Innhold has the word oslo
AND Type is Dokument
) OR (Innhold has the word burgen
AND Type is Dokument
), sort the result with identifikator
and then the search score
.
Example 3
Where Identifikator starts with PA-
AND Arkivskaper (Aktør) navn has the word norsk
AND (Alternativt navn has Oslo
OR Burgen
) AND (Språk has English
OR Lagringsmedium has Glass
).
File Search Example
Â