弹性搜索使用querystring设置排序顺序 [英] elasticsearch set sort order using querystring
本文介绍了弹性搜索使用querystring设置排序顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下简单的弹性搜索查询:
I have the following simple elastisearch query:
http://localhost:9200/apn/presupuesto/_search?q=subcuenta:penal&sort=anio
它工作正常
现在我试图通过anio desc进行排序。我尝试了所有这些选项:
Now I'm trying to order by anio desc. I tried with all these options:
...l&sort=anio desc
...l&sort=-anio
...l&sort=anio&order=desc
但没有一个似乎工作
我该如何实现? (理想情况下,从querystring,而不必使用更复杂的查询)
How can I achieve it? (ideally, from the querystring, without having to use a more complex query)
推荐答案
尝试sort = anio:desc。
Try sort=anio:desc.
请参阅搜索API - uri请求获取参数列表。
这篇关于弹性搜索使用querystring设置排序顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文