Bird
0
0

Given this Elasticsearch query snippet, what fields will be returned in the search results?

medium📝 Predict Output Q13 of 15
Elasticsearch - Search Results and Scoring
Given this Elasticsearch query snippet, what fields will be returned in the search results?
{
  "_source": { "includes": ["title", "author"] },
  "query": { "match_all": {} }
}
AAll fields will be returned
BAll fields except <code>title</code> and <code>author</code> will be returned
CNo fields will be returned
DOnly the fields <code>title</code> and <code>author</code> will be returned
Step-by-Step Solution
Solution:
  1. Step 1: Understand includes in _source

    The includes key specifies which fields to return from the document.
  2. Step 2: Apply to given query

    Since only title and author are included, only these fields will appear in the results.
  3. Final Answer:

    Only the fields title and author will be returned -> Option D
  4. Quick Check:

    includes fields = return only those fields [OK]
Quick Trick: includes means return only listed fields [OK]
Common Mistakes:
MISTAKES
  • Thinking includes excludes fields
  • Assuming all fields return by default
  • Confusing includes with excludes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes