June 2017
Beginner to intermediate
404 pages
8h 22m
English
Post filter is best explained with an example. Suppose in an e-commerce store, a user is looking for a silver-colored cell phone. The products are stored as Elasticsearch documents, and the variations, such as storage and color, are stored as nested documents. To find the cell phone in silver color, the query would look like the following:
#Silver Color Cell Phones POST chapter8/_search { "query": { "bool": { "must": [ { "match": { "category": "Cell Phones" } }, { "nested": { "path": "variations", "query": { "match": { "variations.color": "Silver" } } } } ] } } }
The response to the preceding query contains cell phones in silver color. Suppose that along with silver, we want to display all the color variations that are available. ...
Read now
Unlock full access