Complete the code to define an integer field in Elasticsearch mapping.
{
"mappings": {
"properties": {
"age": { "type": "[1]" }
}
}
}The integer type is used to store whole numbers in Elasticsearch.
Complete the code to define a floating point number field in Elasticsearch mapping.
{
"mappings": {
"properties": {
"price": { "type": "[1]" }
}
}
}The float type stores decimal numbers in Elasticsearch.
Fix the error in the mapping by choosing the correct numeric type for a large integer value.
{
"mappings": {
"properties": {
"population": { "type": "[1]" }
}
}
}The long type is used for large integer values beyond the range of integer.
Fill both blanks to define a mapping with a double and a scaled_float field.
{
"mappings": {
"properties": {
"rating": { "type": "[1]" },
"price_scaled": { "type": "[2]" }
}
}
}double stores double precision floating point numbers.
scaled_float stores floating numbers with a scaling factor for precision.
Fill all three blanks to define a mapping with byte, short, and integer numeric types.
{
"mappings": {
"properties": {
"small_number": { "type": "[1]" },
"medium_number": { "type": "[2]" },
"large_number": { "type": "[3]" }
}
}
}byte stores very small integers.
short stores small integers.
integer stores medium range integers.