A keyword query asks Elasticsearch to evaluate criteria against indexed documents and return matching results. It uses the _search endpoint and can be written with Query DSL or query requests. Text searches may return results ordered by relevance score rather than exact equality. section 8.1 section 8.4
When the target field is full text, Elasticsearch analyzes the query with the field’s analyzer, tokenizes and normalizes it, then matches the resulting tokens in the inverted index. This supports roots, synonyms, and spelling variations. section 3.1.3
Search for several words in a book title
A match query for “Java Complete Guide” searches the title field and highlights matching text. Its default OR behavior can return documents containing any word; set operator to AND when every word must appear. section 10.5.4
Listing 10.5 A match query for a set of words
GET books/_search
{
"query": {
"match": {
"title": {
"query": "Java Complete Guide"
}
}
},
"highlight": {
"fields": {
"title": {}
}
}
}
Use this runnable request to search the books index for title terms and highlight the matches. section 10.5.4


