Understanding the querying and indexing process
Before we see how to search for data, it would be good to understand how the documents and queries sent to ElasticSearch are processed. If you already know that, you can skip this part of the chapter.
In order to understand the querying and indexing process, you should understand the following concepts:
Indexing: This is the process of preparing the document sent to ElasticSearch and storing it in the index.
Searching: This is the process of matching the documents that satisfy the query requirements.
Analysis: This is the process of preparing the content of a field and converting the content to terms that can be written into the Lucene index. During indexing, the data in the fields is divided into a stream of tokens (words) that are written into the index as terms (tokens with additional information such as position in the input text). The analysis process can consist of the following steps:
Tokenization: During this stage, the input text...