Knowing how to index data in Elasticsearch is important, but knowing how to ask the data precise questions is even more crucial. Whether you are using Elasticsearch for site search, product search, operational analytics, or business intelligence, knowing how to formulate search queries is vital to deriving value from all that data you’ve managed to collect. In this hands-on lab, you will get to perform a series of term-level and full-text search queries.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create a search query that meets the requirements of Query 1.
Use the Kibana console tool to execute the following:
GET shakespeare/_search { "query": { "term": { "speaker.keyword": { "value": "ROMEO" } } } }
- Create a search query that meets the requirements of Query 2.
Use the Kibana console tool to execute the following:
GET shakespeare/_search { "size": 25, "query": { "terms": { "play_name.keyword": [ "Henry VI Part 1", "Henry VI Part 2", "Henry VI Part 3" ] } } }
- Create a search query that meets the requirements of Query 3.
Use the Kibana console tool to execute the following:
GET shakespeare/_search { "size": 5, "query": { "match": { "text_entry": "London" } } }
- Create a search query that meets the requirements of Query 4.
Use the Kibana console tool to execute the following:
GET shakespeare/_search { "query": { "match_phrase": { "text_entry": "O Romeo" } } }