-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Unable to sort in 8.4+ if a field doesn't exist. #102723
Comments
I think this PR might be the related #88399 |
Pinging @elastic/es-search (Team:Search) |
@desean1625 does it work when you set |
@desean1625 I reproduced your steps, when i switch the type to float which is the same type of avgticketprice, it is works. |
@Villegas12 We are seeing this issue on our production system. (What is Glenn's username to tag?) |
@desean1625 @Villegas12 if you use a Looking at the Kibana issue, this does seem like a bug in Discover, I will comment over there to clarify. Basically, Elasticsearch is attempting to sort things of two different types. It cannot do that. Elasticsearch could be better about merging sorted types if one of the types has no results (and thus doesn't actually need to be merged). I am not sure if that is the case here or not. |
OK, I have confirmed indeed that #88399 changed the behavior. The following test passes if I revert the change in that PR. But fails currently.
Basically, if there are no docs in the other index with the sort field at all, we don't run into any issues. This is the changed behavior, we are eagerly checking even if there are no docs with the field that mismatch the types. I will talk with the team to see if we can think of a way to not throw in the scenario. Thank you @desean1625 @Villegas12 for digging in and finding this issue! |
@benwtrent Thanks. Is there any chance of a backport to 8.6.2? |
@desean1625 we don't do any additional bug-fix releases once a minor has been released. We will work on getting it into 8.11.x. |
Yes, sorry that makes sense. What I meant to ask was any change of a back port to the 8.6 branch and a minor release 8.6.3 to fix this. |
There will not be an 8.6.3 release. We only do bug fix releases for the last major 7.x.y and the last minor 8.11.y (8.11 is the currently released minor, 8.12 will be next). https://www.elastic.co/support/eol
|
…astic#102779) When searching multiple indices and a field only exists in ONE of the indices, we should allow sorting by that field, regardless of the "unmapped" type provided. closes: elastic#102723 (cherry picked from commit 43dc74b)
…ort (#102779) (#102834) * Allow mismatched sort-by field types if there are no docs to sort (#102779) When searching multiple indices and a field only exists in ONE of the indices, we should allow sorting by that field, regardless of the "unmapped" type provided. closes: #102723 (cherry picked from commit 43dc74b) * fixing compile * fixing format
Elasticsearch Version
8.10.3
Installed Plugins
No response
Java Version
bundled
OS Version
docker
Problem Description
Cannot sort by field if there are blank values
{
"name": "es-1-master-2",
"cluster_name": "es-1",
"cluster_uuid": "kQ8-xy6FQeqjR8Zmc_a9HQ",
"version": {
"number": "8.10.3",
"build_flavor": "default",
"build_type": "docker",
"build_hash": "c63272efed16b5a1c25f3ce500715b7fddf9a9fb",
"build_date": "2023-10-05T10:15:55.152563867Z",
"build_snapshot": false,
"lucene_version": "9.7.0",
"minimum_wire_compatibility_version": "7.17.0",
"minimum_index_compatibility_version": "7.0.0"
},
"tagline": "You Know, for Search"
}
Steps to Reproduce
Steps to recreate issue.
From kibana add sample data sets ['Sample flight data','Sample eCommerce orders']
Create dataview
name:test
index patter:kibana_*
timefield: --- I don't want to use the time filter ---
From discover sort by AvgTicketPrice, or run query
Can't sort on field [AvgTicketPrice]; the field has incompatible sort types: [LONG] and [FLOAT] across shards!
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: