June 2017
Beginner to intermediate
404 pages
8h 22m
English
Match phrase query is similar to the match query but is used to query text phrases. Phrase matching is necessary when the ordering of the words is important. Only the documents that contain the words in the same order as the search input are matched.
During the indexing process, along with the token, the position of the word in the text is also saved to the inverted index. The position information is then used in the phrase query. For example, to find an all season jacket, we will use the match phrase query on the description field. The query is shown here:
#Match Phrase POST chapter6/_search { "query": { "match_phrase": { "description": "All season jacket" } } }
The preceding query will not match any product as the ...
Read now
Unlock full access