Term-Level Queries: Term Query
Learn about the term query and how to use it.
We'll cover the following...
Term query
A term query is a type of query used to search for documents containing an exact term or value in a specific field. It is designed for searching keyword
fields, which are stored in the inverted index without any analysis or tokenization. Term queries are particularly useful for exact matches, such as searching for a product ID or username, where an exact match is necessary.
When a term query is executed, it directly compares the search query with the terms (tokens) stored in the inverted index. The term query looks for exact matches, meaning it seeks to find the search query exactly as it appears in the inverted index. Unlike full-text queries that perform text analysis and consider various factors, such as stemming and tokenization, a term query does not perform any such analysis. It solely focuses on identifying the precise matches of the search query within the inverted index.
Term query syntax
To perform a term
query, we can send a GET
request to the ...