Info |
---|
Information valid from AMI version 8.0sp2 |
Summary
AMI uses Elasticsearch Simple Query String queries to perform free-text search. This lets you control aspects of a search using a basic Query String Syntax.
Free-text searches are used in the Search filter and for facets indexed as Text.
Table of Contents | ||
---|---|---|
|
Terms
Search terms are searched for word by word. For example, if you entered the search terms onion
rings
then AMI would show results that had values that included either rings
or onion
: values of gold rings
and red onions
would both be valid matches, not just onion
rings
.
You can search for complete phrases by enclosing terms in double quote "
characters. Entering "onion rings"
would not match values of either gold rings
or red onions
.
When attributes are indexed for searching, any embedded references to other attributes, glossary terms or other Agility content is fully resolved. That means you cannot use free-text searching to look for reference tags.
Reserved characters
Some characters have a special meaning in Elasticsearch queries. These reserved characters should be escaped with a leading backslash character \
The reserved characters are: + - = && | | > < ! ( ) { } [ ] ^ " ~ * ? : \ /
For example, to filter a facet for a value containing 1/2 you should set the term to 1\/2
.
The <
and >
characters cannot be escaped.
Do not include them in a search term.
Syntax
This table lists the Elasticsearch Simple Query String Syntax supported in AMI. See Elasticsearch's own Simple Query String Syntax document (www.elastic.co) for more information.
Syntax | Description | Example |
---|
| By default multi-term searches are OR'd together. Example: find matches that contain the word |
canadian bacon
|
|
|
+ | Use |
AND
/&&
keyword + if both terms are required (in any order or position). |
|
|
canadian && bacon
- | Use |
NOT
/!
/ |
for words that must not be present. |
canadian AND bacon NOT film
Use the +
operator to specify that a term must be present.
Example: the word bacon
must be present, while the word canadian
is optional (but will increase a result's relevance if it is present)
canadian +bacon
canadian AND (bacon OR ham)
Wildcard searches can be run on individual terms, using ?
to replace a single character, and *
to replace zero or more characters.
Warning |
---|
Using the * wildcard at the beginning or end of a search term can use a lot of resources. |
qu?ck bro*
Regular expression patterns can be embedded in the query string by wrapping them in forward-slashes
Warning |
---|
There is a performance overhead when using Regular Expressions. |
/joh?n(ath[oa]n)/
Note that the example shows a search intended to find a value with both | canadian + bacon + -film |
~N after a word | You can search for terms that are similar to, but not exactly like the search term using the “fuzzy” operator (~). |
The edit distance is the number of insertions, deletions, substitutions or transpositions required to change one word into another. See Damerau–Levenshtein distance (Wikipedia) for more information. |
quikc~ brwn~ foks~
quikc~1 brwn~1 foks~1 | |
~N after a phrase | You can |
^)
to make one term more relevant than another. The default boost value for terms is 1: the positive number after the boost operator sets the relative relevance of the preceding term or grouping.quick^2 brown fox^0.5
set a slop amount for a phrase to indicate the number of words within it that may be different and still match. The example would match value of | "quick red fox"~1 | |
( ) | Use parentheses ( and ) to signify logical precedence. | quick + (brown | red) + fox |
* | Use * to signify a prefix query. | qu* |