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
{{ message }}
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
POST /sample_order/_bulk
{"index":{"_id":1}}
{"orderNo":"1","orderLines":[{"item":{"itemDesc":"SampleItemDesc1","itemID":11}}]}
{"index":{"_id":2}}
{"orderNo":"2","orderLines":[{"item":{"itemDesc":"SampleItemDesc2","itemID":22}}]}
Now if we want to run following query:
{
"query": "SELECT * FROM sample_order where orderLines.item.itemID=11",
"fetch_size": 10
}
It doesn't return any records.
If we change it to:
{
"query": "SELECT * FROM sample_order where nested(orderLines.item.itemID)=11",
"fetch_size": 10
}
It throws error mentioning:
nested object under path [orderLines.item] is not of nested type
How can we query objects inside nested structures?
Could you please assist in this Experts. We really appreciate your help!
Thanks!
The text was updated successfully, but these errors were encountered:
Hello Experts,
Our Index Mapping has several nested structures and objects within it. Just to showcase the issue, please consider the following sample mapping
PUT /sample_order
{
"mappings": {
"properties": {
"orderNo":{
"type": "text"
},
"orderLines": {
"type": "nested",
"properties": {
"item": {
"type": "object",
"properties": {
"itemDesc": {
"type": "text"
},"itemID": {
"type": "integer"
}
}
}
}
}
}
}
}
POST /sample_order/_bulk
{"index":{"_id":1}}
{"orderNo":"1","orderLines":[{"item":{"itemDesc":"SampleItemDesc1","itemID":11}}]}
{"index":{"_id":2}}
{"orderNo":"2","orderLines":[{"item":{"itemDesc":"SampleItemDesc2","itemID":22}}]}
Now if we want to run following query:
{
"query": "SELECT * FROM sample_order where orderLines.item.itemID=11",
"fetch_size": 10
}
It doesn't return any records.
If we change it to:
{
"query": "SELECT * FROM sample_order where nested(orderLines.item.itemID)=11",
"fetch_size": 10
}
It throws error mentioning:
nested object under path [orderLines.item] is not of nested type
How can we query objects inside nested structures?
Could you please assist in this Experts. We really appreciate your help!
Thanks!
The text was updated successfully, but these errors were encountered: