Check it out:
curl -XDELETE -HContent-Type:application/json -uelastic:password localhost:9200/test
curl -XPOST -HContent-Type:application/json -uelastic:password localhost:9200/test/_doc?refresh -d'{
"foo": {
"cat": "meow"
},
"foo.bar": "baz"
}'
curl -XPOST -HContent-Type:application/json -uelastic:password localhost:9200/test/_search?pretty -d'{
"fields": ["foo.bar"]
}'
Makes this:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "test",
"_id" : "kyfg_3UBbogJq0WOeKye",
"_score" : 1.0,
"_source" : {
"foo" : {
"cat" : "meow"
},
"foo.bar" : "baz"
}
}
]
}
}
Notice no fields in the response. This seems to be because we found the foo object and didn't find bar inside it. I'm not sure though. It seems like we should find foo.bar.
These kinds of documents are confusing in general and folks probably shouldn't be sending them to us. I think generally if we get them it is because someone made a mistake in their application. But we should still handle them.
Check it out:
Makes this:
Notice no
fieldsin the response. This seems to be because we found thefooobject and didn't findbarinside it. I'm not sure though. It seems like we should findfoo.bar.These kinds of documents are confusing in general and folks probably shouldn't be sending them to us. I think generally if we get them it is because someone made a mistake in their application. But we should still handle them.