9 Term-level search
This chapter covers
- Overview of term-level queries
- Term-level queries in action
Term-level search is designed to work with structured data such as numbers, dates, IP address, enumerations, keyword types, and others. We use term-level queries to find an exact match. This short chapter solely focuses on understanding the term-level search in detail and works through the various query types with examples.
The source code for this chapter is available on my GitHub page here:
Let’s begin with an overview of term-level searches and then we will look at specific queries.
9.1 Overview of term-level search
The term-level search is a structured search where the queries return results in exact matches. They search for structured data such as dates, numbers, and ranges. With this type of search, we don't care about how well the results match (like how well the documents correspond to the query) but that it returns the data (or not) if the query is matched. Hence, we do not expect a relevancy score associated with the results from a term-level search.
The term-level search produces a Yes or No binary option similar to the database’s WHERE clause. The basic idea for this kind of search is that the results are binary: the query results are fetched if the condition is met; otherwise, it returns none if the condition fails.