Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whether or not support sort filter operation by sql #301

Open
smallAttr opened this issue Nov 24, 2021 · 2 comments
Open

Whether or not support sort filter operation by sql #301

smallAttr opened this issue Nov 24, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@smallAttr
Copy link

Is your feature request related to a problem? Please describe.
Whether or not support sort filter operation by sql?
for example:

  1. put data to es index:
    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" } ] }
  2. dsl expression
    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.

@smallAttr smallAttr added the enhancement New feature or request label Nov 24, 2021
@smallAttr
Copy link
Author

smallAttr commented Dec 1, 2021

@chloe-zh please

@chloe-zh
Copy link
Contributor

chloe-zh commented Dec 1, 2021

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.

Yury-Fridlyand added a commit that referenced this issue Aug 21, 2023
* Fix `ASCII` function and groom UT for text functions.



* Code cleanup.



---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Aug 23, 2023
* Fix `ASCII` function and groom UT for text functions.

* Code cleanup.

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
(cherry picked from commit 6055c7e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Yury-Fridlyand pushed a commit that referenced this issue Aug 24, 2023
…2029)

* Fix `ASCII` function and groom UT for text functions.

* Code cleanup.

---------


(cherry picked from commit 6055c7e)

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants