In the last chapter, we looked at term-level searching, the mechanism we use to search structured data. Although a structured data search is important, the power of modern search engines vests efficiently and effectively to run when we search unstructured data. Elasticsearch is one such modern search engine that stands as a front-runner in searching unstructured data with relevance.
Elasticsearch provides the capability to search unstructured data through full-text search queries. A full-text search is all about relevancy: fetching the relevant documents to the user’s search. For example, when searching for the word Java in an online bookstore, one shouldn’t expect to receive details about the Indonesian island of Java or the wet-pressed coffee grown on this island.
In this chapter, we review the mechanics of searching unstructured data by employing full-text search APIs. Elasticsearch provides a handful of full-text queries in the form of match, query_string, and others. As match queries are the most commonly used queries when working with full text, we dedicate a good chunk of the chapter to various match queries. We also work through query-string searches, which are equivalent to using an URI request search but with a request body similar to Query DSL.