Hi, I have created a local Elasticsearch index and I am using the following mapping:
"docs": {
"properties": {
"dates": {"type": "nested","properties": {"count": {"type": "long"},"name": {"type": "long"}}},
"entities": { "type": "nested","properties": { "count": {"type": "long"},"name": {"type":"string","fields": { "raw": {"type": "string", "index": "not_analyzed","null_value": "NULL"}}}}},
"locations": { "type": "nested", "properties": {"admin1Code": {"type": "string", "fields": {"raw":{"type": "string", "index": "not_analyzed","null_value": "NULL"}}},
"admin2Code": { "type": "string", "fields": {"raw": {"type":"string","index":"not_analyzed","null_value": "NULL"}}},
"countryCode": {"type": "string","fields": {"raw": {"type":"string","index":"not_analyzed","null_value": "NULL"}}},
"location": {"type": "geo_point","lat_lon": true,"geohash": true},"name": {"type":"string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}},
"rawText": {"type": "string","fields": {"raw": {"type":"string","index":"not_analyzed","null_value": "NULL"}}},
"count": {"type": "long"}}},
"id": {"type": "string"},
"geo": {"type": "geo_point","lat_lon": true,"geohash": true},
"mime-type": {"type":"string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}},
"places": {"type": "nested","properties": {"count": {"type": "long"},"name": {"type":"string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}}}},
"people": {"type": "nested","properties": {"count": {"type": "long"},"name": {"type":"string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}}}},
"organizations": {"type": "nested","properties": {"count": {"type": "long"},"name": {"type": "string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}}}},
"money": {"type": "nested","properties": {"count": {"type": "long"},"name": {"type":"string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}}}},
"percentages": {"type": "nested","properties": {"count": {"type": "long"},"name": {"type":"string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}}}},
"time": {"type": "nested","properties": {"count": {"type": "long"},"name": {"type": "string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}}}},
"measurements": {"type": "nested","properties": {"value": {"type": "long"},"unit": {"type": "string","fields": {"raw": {"type": "string","index": "not_analyzed","null_value": "NULL"}}}}}
}
}
and this is my local indexed data:
data.json
I can see valid measurements field in my data. But when I access it using Elasticsearch aggregation .raw field, empty buckets are returned. When I remove .raw field and access it normally some of the buckets are returned. This doesn't make sense. It should return buckets for valid measurements with .raw field as well. I want the measurements to show up with .raw field as well. Can somebody please help? Thank you!