Skip to main content
InterviewHubPRO
Section Overview
Q7

Question 7 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

14%
Elasticsearch & Lucene (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What is the difference between a Match Query and a Term Query?

junior LevelCode ExampleelasticsearchBasic

In Simple Words:

  • Match Query: The query string is passed through the analyzer (lowercased, stemmed, tokenized) before searching the inverted index. Used for full-text fields (text).
  • Term Query: The query string is looked up verbatim without any analysis. Used strictly for exact matches on keyword fields (e.g. numbers, booleans, exact tags).
json
// Term query for exact status match:
{
  "query": {
    "term": { "status": "active" }
  }
}