Bird
0
0

Given this request to create an index:

medium📝 query result Q13 of 15
Elasticsearch - Index Management
Given this request to create an index:
{
  "settings": {"number_of_shards": 1},
  "mappings": {
    "properties": {
      "name": {"type": "text"},
      "price": {"type": "float"}
    }
  }
}

What will be the type of the price field in the index?
Akeyword
Bfloat
Cinteger
Dtext
Step-by-Step Solution
Solution:
  1. Step 1: Read the mapping for the price field

    The mapping defines "price" with "type": "float" which means it stores decimal numbers.
  2. Step 2: Understand field types

    Float is a number with decimals, integer is whole number, text is for full text search, keyword is for exact matches.
  3. Final Answer:

    float -> Option B
  4. Quick Check:

    price type = float [OK]
Quick Trick: Check mapping 'type' for field data type [OK]
Common Mistakes:
MISTAKES
  • Confusing float with integer
  • Assuming text type for numbers
  • Mixing keyword with numeric types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes