Elasticsearch sort not work in "es.query"
See original GitHub issuewhen set es.query
to:
{
"query" : {
"bool" : {
"filter" : {
"range" : {
"collectionTimestamp" : {
"from" : "2016-01-04T00:00Z",
"to" : "2016-01-04T00:00:10Z",
"include_lower" : true,
"include_upper" : true
}
}
},
"minimum_should_match" : "1"
}
},
"sort" : [ {
"vendor" : {
"order" : "asc",
"missing" : "_first"
}
} ]
}
the query partition works good but results are not ordered.
If order by spark, spark first get all elements and then sort them to get just 10 first elements and this is very slow if results are large. but if use elasticsearch sort, when spark gets 10 first elements, it finishes the work and return the results.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Elasticsearch is not sorting the results - Stack Overflow
The problem is that elasticsearch always returns the same results. The query part works fine, however returns the same list for asc and...
Read more >Sort search results | Elasticsearch Guide [8.5] | Elastic
When sorting, the relevant sorted field values are loaded into memory. This means that per shard, there should be enough memory to contain...
Read more >How Do I Sort in Elasticsearch? - Linux Hint
We can sort Elasticsearch results using the sort keyword. The sort query requires you to provide a field under which to sort. Elasticsearch...
Read more >Sorting of results in Elasticsearch | Asc, Desc ... - YouTube
In this elastic search tutorial, we discuss about Sorting the search results in Elasticsearch. This is part of Query DSL (Domain Specific ...
Read more >8. Sorting and Relevance - Elasticsearch - O'Reilly
In order to sort by relevance, we need to represent relevance as a value. In Elasticsearch, the relevance score is represented by the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
At least, an error could be thrown to indicate this is not supported.
Closing this since the conversation has slowed down and drifted from the original issue. The usage of sorting within an input split is a very niche use case and not one that we have on the immediate roadmap. If there is still reasonable push from the community for it then a new issue should be opened for the feature.