hi,

can elasticsearch sort by rounded date ?
i want to sort by document creation date but rounded to 1 day, something 
like that:

"sort": [
       
          "CreationDate*/1d*"
      
    ]

solr supports this type of sorting, so i expect elasticsearch is supporting 
it too, but i cant find any documentation for that

i tried scripted sorting but it is much slower, for example sorting 30m 
documents:

"sort": [
        {
            "_script" : 
            {
                "script" : "doc['CreationDate'].value",
                "type" : "number",
                "order": "desc"
            }
        }
    ]

vs

"sort": [
        {
          "CreationDate": {
             "order": "desc"
         }
       }
    ]

first one (script)  is like 50 times slower (i guess because it is loading 
CreationDate from _source)



-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/cbb2fb50-3ccb-4ed3-8de2-95280666241f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to