June 2017
Beginner to intermediate
404 pages
8h 22m
English
The basic query in Elasticsearch is term query. It is very simple and can be used to query numbers, boolean, dates, and text. Term query is used to look up a single term in the inverted index. Match query, on the other hand, takes care of the mapping and calls term query internally. Match query should be your go-to query. We will describe the differences in detail in the Term versus Match query section.
A simple term query looks like the following:
POST chapter6/product/_search { "query": { "term": { "product_name" : "jacket" } } }
Term query works great for a single term. To query more than one term, we have to use terms query. It is similar to in clause in a relational database. If the document matches ...
Read now
Unlock full access