Hi Support,
I have data as below.
DELETE test_nested_vs_object
PUT test_nested_vs_object
{
"mappings": {
"properties": {
"id": {
"type":"long"
},
"title" :
{
"type": "text"
},
"categories": {
"type": "object",
"properties": {
"d": {
"type": "short"
}
}
}
}
}
}
POST test_nested_vs_object/_doc
{
"id" : 1,
"title" : "An article title 1",
"categories" : [{"d":1}]
}
POST test_nested_vs_object/_doc
{
"id" : 2,
"title" : "An article title 2 ",
"categories" : [{"d":1},{"d":2}]
}
POST _sql
{
"query": "select * from test_nested_vs_object where categories.d = 2 "
}
Which data type is preferable for above data?
if we use object / Nested on huge index,which will give better performance on sql query?
How we can use/fetch object field using elasticsearch SQL query on object type field?
Thanks