Supply a custom `Sort.Order` providing Elasticsearch specific parameters
See original GitHub issueSpring Data Elasticsearch should supply a Sort.Order
derived class that can provide custom parameters like ignore_unmapped
(see #1908) for an example where this is needed
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:17
Top Results From Across the Web
Multiple Custom Sorting in Elastic Search - Elasticsearch
You can provide multiple sort clauses to indicate what the primary, secondary, etc sort order should be. And because the sort clause can...
Read more >ElasticSearch: sort in specific order - Stack Overflow
i have an indexed string field in my docs with letters a-z as possible values. Is it possible to sort ...
Read more >Custom Sorting with Parameters in Tableau - Evolytics
The Sort By and Sort Order parameters can conveniently be placed anywhere on the dashboard to provide a streamlined user experience.
Read more >42 Elasticsearch Query Examples - Tutorial - Coralogix
Let's see what happens when we provide the operator parameter “AND” in ... When there is no sort parameter specified in the search...
Read more >MongoDB Sorting: sort() Method & Examples - BMC Software
Database sorting presents data in an ascending or descending order with relation to the data in a specified field. You can carry out...
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 Free
Top 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
that was exactly the point of this issue. So now it is possible to do
and use that sort in a
Pageable
as parameter or whatever.How is this date field mapped in your index? Is it really unmapped? What does /<indexname>/_mappings show for that property? If you have data for that property in the index then it will be surely mapped, so adding an unmapped type to a sort has not effect. What is the problem that you have with the sorting?
As for the temporal types:
java.util.Date
is an instance in time in UTC time zone. ALocalDateTime
does not have a timezone, so it cannot be instantiated from a long. The appropriate data type would bejava.time.Instant
@sothawo I’m using Spring 5.3 and Spring Data ES 4.3
I, personally, think it is reasonable to make
java.time.Instant
behave likejava.util.Date
since they are very closely related and because, from an engineering stand-point, normalizing your date-time’s to UTC is actually good practice, as the default behaviour … of course, the default isn’t always desired, but some default can be reasonable … but since this is a “bigger” problem that falls under the Spring Data umbrella (not just Spring Data Elasticsearch) then I’m not about to fight for this since it’s not a battle I have time for@Field
annotation?