No, I don't think sorting on booleans works. At least I've had no luck with it.
On Tuesday, January 6, 2015 at 6:34:52 AM UTC, David Pilato wrote: > > I think sorting on boolean should work. > > If you can't make it working, you could also use function_score to "boost" > expires:true vs expires:false. > > HTH > > -- > David ;-) > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs > > Le 5 janv. 2015 à 23:09, mba...@trunkclub.com <javascript:> a écrit : > > I would like to sort the results of a query such that all of the records > with a value of true in the expires field will be at the top. I am not > using relevance for sorting. I tried adding this as a sort, but it doesn't > seem to work with either sorting order: { expires: { order: "desc" } } > > All of the records are in the result but they aren't sorted. Is there a > different way I should be going about this? > > For reference, here is my entire query: > > { > "query": { > "match_all": { > } > }, > "size": 50, > "from": 0, > "fields": [ > "id" > ], > "sort": [ > { > "expires": { > "order": "desc" > } > } > ] > } > > -- > 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 elasticsearc...@googlegroups.com <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/0bfc5579-8855-44a8-97e3-58ede3bb10d4%40googlegroups.com > > <https://groups.google.com/d/msgid/elasticsearch/0bfc5579-8855-44a8-97e3-58ede3bb10d4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > -- 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/68ead506-a232-43ba-9f16-b5d933132de7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.