Bird
0
0

Which Elasticsearch query structure correctly performs a match search on the content field for the term "database"?

easy📝 Syntax Q3 of 15
Elasticsearch - Basic Search Queries
Which Elasticsearch query structure correctly performs a match search on the content field for the term "database"?
A{ "query": { "term": { "content": ["database"] } } }
B{ "query": { "match": { "content": "database" } } }
C{ "query": { "match": { "content": ["database"] } } }
D{ "query": { "term": { "content": "database" } } }
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct query type

    The match query is used for full-text search and accepts a string value.
  2. Step 2: Check the syntax

    The correct syntax is { "query": { "match": { "field": "value" } } }. Arrays are not valid for match values.
  3. Final Answer:

    { "query": { "match": { "content": "database" } } } -> Option B
  4. Quick Check:

    Match query with string value [OK]
Quick Trick: Match query uses string, not array, for search terms [OK]
Common Mistakes:
MISTAKES
  • Using arrays instead of strings in match queries
  • Confusing term query with match query syntax
  • Using term query for full-text search

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes