You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If two properties in a document have the same prefix up to a '.' (dot/period), then queries for the fields that include the '.' will return the same value as the prefix without.
#Delete Test Index
curl -XDELETE localhost:9200/test
#Create a document with property names similar up to a '.'
curl -XPUT http://localhost:9200/test/test/1 -d '{ "foo" : "val", "foo.bar" : "val_WILL_NOT_SHOW", "foo.bat" : "val_THIS_EITHER"}'#Query for specific fields and note the incorrect values
curl -XGET 'http://localhost:9200/test/test/_search?q=val&pretty&fields=foo,foo.bar,foo.bat'
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.15342641,
"hits": [ {
"_index":"test",
"_type":"test",
"_id":"1",
"_score": 0.15342641,
"fields": {
"foo.bat": [ "val" ],
"foo.bar": [ "val" ],
"foo": [ "val" ]
}
} ]
}
}
#Same query with no fields specified
curl -XGET 'http://localhost:9200/test/test/_search?q=val&pretty'
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.15342641,
"hits": [ {
"_index":"test",
"_type":"test",
"_id":"1",
"_score": 0.15342641,
"_source":
{
"foo":"val",
"foo.bar":"val_WILL_NOT_SHOW",
"foo.bat":"val_THIS_EITHER"
}
} ]
}
}
The text was updated successfully, but these errors were encountered:
If two properties in a document have the same prefix up to a '.' (dot/period), then queries for the fields that include the '.' will return the same value as the prefix without.
The text was updated successfully, but these errors were encountered: