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 I have an inner object that has the same name as a type, then queries for that inner object will fail.
The workaround is to rename the type or the inner object, but the behaviour is confusing and misleading (and wrong).
To reproduce, create a new index, type and document:
curl -XPOST 'localhost:9200/test/flow/' -d '{
"device": {
"id": "dummy"
}
}'
Querying for that document by device.id will work:
curl 'localhost:9200/test/_search?pretty' -d '{
"query":{
"filtered": {
"filter": {
"term": {
"device.id": "dummy"
}
}
}
}
}'
Add a type with the same name as the inner object, AND containing an inner object with that name as well:
curl -XPOST 'localhost:9200/test/device/' -d '{
"device": {
"id": "foo"
}
}'
Now querying for the original document by device.id will fail:
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
Removing the 'device' type will allow the original document to be queryable again:
curl -XDELETE 'localhost:9200/test/device'
The text was updated successfully, but these errors were encountered:
If I have an inner object that has the same name as a type, then queries for that inner object will fail.
The workaround is to rename the type or the inner object, but the behaviour is confusing and misleading (and wrong).
To reproduce, create a new index, type and document:
curl -XPOST 'localhost:9200/test/flow/' -d '{
"device": {
"id": "dummy"
}
}'
Querying for that document by device.id will work:
curl 'localhost:9200/test/_search?pretty' -d '{
"query":{
"filtered": {
"filter": {
"term": {
"device.id": "dummy"
}
}
}
}
}'
Add a type with the same name as the inner object, AND containing an inner object with that name as well:
curl -XPOST 'localhost:9200/test/device/' -d '{
"device": {
"id": "foo"
}
}'
Now querying for the original document by device.id will fail:
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
Removing the 'device' type will allow the original document to be queryable again:
curl -XDELETE 'localhost:9200/test/device'
The text was updated successfully, but these errors were encountered: