ElasticSearch query string Query

From GM-RKB
Jump to navigation Jump to search

An ElasticSearch query_string Query is an ElasticSearch match query that is a match_phrase query (that analyzes the text and creates a phrase query out of the analyzed text).



References

2012


  • http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_fuzziness
    • We can search for terms that are similar to, but not exactly like our search terms, using the “fuzzy” operator: quikc~ brwn~ foks~ This uses the Damerau-Levenshtein distance to find all terms with a maximum of two changes, where a change is the insertion, deletion or substitution of a single character, or transposition of two adjacent characters. The default edit distance is 2, but an edit distance of 1 should be sufficient to catch 80% of all human misspellings. It can be specified as: quikc~1


  • http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_proximity_searches
    • While a phrase query (eg "john smith") expects all of the terms in exactly the same order, a proximity query allows the specified words to be further apart or in a different order. In the same way that fuzzy queries can specify a maximum edit distance for characters in a word, a proximity search allows us to specify a maximum edit distance of words in a phrase: "fox quick"~5 The closer the text in a field is to the original order specified in the query string, the more relevant that document is considered to be. When compared to the above example query, the phrase "quick fox" would be considered more relevant than "quick brown fox".