October 2019
Beginner
186 pages
5h 39m
English
The post filter is applied to the hits that are returned after a search request. Let's create the chocolates index, which will include the brand, flavours, and taste fields. We will use this index to explain the post filter:
PUT /chocolates{ "mappings": { "properties": { "brand": { "type": "keyword" }, "flavours": { "type": "keyword" }, "taste": { "type": "keyword" } } }}
The preceding expression creates the chocolates index. Now, let's add a certain type of chocolate with the company's information. To do that, we need to execute the following query:
PUT /chocolates/_doc/1?refresh{ "brand": "milka", "flavours": "dark chocolate", "taste": "salty"}
The preceding expression adds a document to the chocolates index. In the same way, ...
Read now
Unlock full access