Open smallAttr opened 2 years ago
@chloe-zh please
Hi @smallAttr unfortunately we have not supported nested fields in sql new engine yet, so the new engine is not able to execute queries like your example. But I'm not sure if old engine supports it or not, I will try it out later and respond here.
Besides, for sort and filter for plain fields, you can try ,order by
for sort and where
for filter.
Is your feature request related to a problem? Please describe. Whether or not support sort filter operation by sql? for example:
PUT /my_index/blogpost/2 { "title": "Investment secrets", "body": "What they don't tell you ...", "tags": [ "shares", "equities" ], "comments": [ { "name": "Mary Brown", "comment": "Lies, lies, lies", "age": 42, "stars": 1, "date": "2014-10-18" }, { "name": "John Smith", "comment": "You're making it up!", "age": 28, "stars": 2, "date": "2014-10-16" } ] }
GET /_search { "query": { "nested": { "path": "comments", "filter": { "range": { "comments.date": { "gte": "2014-10-01", "lt": "2014-11-01" } } } } }, "sort": { "comments.stars": { "order": "asc", "mode": "min", "nested_filter": { "range": { "comments.date": { "gte": "2014-10-01", "lt": "2014-11-01" } } } } } }
Describe the solution you'd like so, how to do resolve it by sql? up to now , can not find any relevant information?
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.