-
Notifications
You must be signed in to change notification settings - Fork 190
[BUG] Nested Function With Sort Doesn't Sort Inner Hits #1788
Copy link
Copy link
Closed as not planned
Labels
bugSomething isn't workingSomething isn't workinglegacyIssues related to legacy query engine to be deprecatedIssues related to legacy query engine to be deprecated
Description
What is the bug?
Sorting on nested fields does not sort inner_hits of response.
Dataset:
{"index":{"_id":"1"}}
{"message":[{"info":"c"},{"info":"a"}]}
{"index":{"_id":"2"}}
{"message":{"info":"d"}}
Mapping:
{
"mappings": {
"properties": {
"message": {
"type": "nested",
"properties": {
"info": {
"type": "keyword",
"index": "true"
}
}
}
}
}
}Query:
SELECT nested(message.info) FROM nested_objects ORDER BY nested(message.info) DESC;Response:
{
"schema": [
{
"name": "message.info",
"type": "keyword"
}
],
"total": 3,
"datarows": [
[
"d"
],
[
"c"
],
[
"a"
]
],
"size": 3,
"status": 200
}How can one reproduce the bug?
Steps to reproduce the behavior:
- Upload dataset with index mapping.
- Run SQL query.
- Verify Results.
What is the expected behavior?
The hits portion of the response is sorted, and the inner_hits portion is not sorted. The inner_hits could be sorted, but this would be two separate sorts and all returned data would not be one contiguous sort. Perhaps an in-memory solution may be the only fix here.
What is your host/environment?
- OS: IOS
- Version: 13.4.1
- Plugins: SQL
Do you have any screenshots?
N/A
Do you have any additional context?
Legacy engine bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinglegacyIssues related to legacy query engine to be deprecatedIssues related to legacy query engine to be deprecated