Bird
0
0

You want to store a user's profile with fields: username (exact match), bio (full-text search), and signup_date (date range queries). Which mapping correctly defines these fields?

hard📝 schema Q15 of 15
Elasticsearch - Index Management
You want to store a user's profile with fields: username (exact match), bio (full-text search), and signup_date (date range queries). Which mapping correctly defines these fields?
A{ "properties": { "username": { "type": "keyword" }, "bio": { "type": "text" }, "signup_date": { "type": "date" } } }
B{ "properties": { "username": { "type": "text" }, "bio": { "type": "keyword" }, "signup_date": { "type": "text" } } }
C{ "properties": { "username": { "type": "integer" }, "bio": { "type": "text" }, "signup_date": { "type": "date" } } }
D{ "properties": { "username": { "type": "keyword" }, "bio": { "type": "keyword" }, "signup_date": { "type": "integer" } } }
Step-by-Step Solution
Solution:
  1. Step 1: Match each field to its correct type

    Username needs exact matches, so "keyword" is correct. Bio needs full-text search, so "text" is correct. Signup_date needs date range queries, so "date" is correct.
  2. Step 2: Verify the options

    { "properties": { "username": { "type": "keyword" }, "bio": { "type": "text" }, "signup_date": { "type": "date" } } } matches all these requirements correctly. Others mix types incorrectly.
  3. Final Answer:

    { "properties": { "username": { "type": "keyword" }, "bio": { "type": "text" }, "signup_date": { "type": "date" } } } -> Option A
  4. Quick Check:

    Correct types for exact, full-text, and date fields [OK]
Quick Trick: Use keyword for exact, text for full-text, date for dates [OK]
Common Mistakes:
MISTAKES
  • Mixing keyword and text types incorrectly
  • Using integer for date fields
  • Confusing full-text and exact match types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes