ElasticSearch查询返回信息根据字段排序(英文检索)
生活随笔
收集整理的這篇文章主要介紹了
ElasticSearch查询返回信息根据字段排序(英文检索)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?根據年齡降序排序
#排序 GET /lib3/user/_search {"query": {"match_all": {}},"sort":[{"age": {"order" :"desc"}}] } {"took" : 1,"timed_out" : false,"_shards" : {"total" : 5,"successful" : 5,"skipped" : 0,"failed" : 0},"hits" : {"total" : 5,"max_score" : null,"hits" : [{"_index" : "lib3","_type" : "user","_id" : "1","_score" : null,"_source" : {"name" : "zhaoliu","address" : "hei long jiang sheng tie ling shi","age" : 50,"birthday" : "1970-12-12","interests" : "xi buan hejiu, duanlian, lvyou"},"sort" : [50]},{"_index" : "lib3","_type" : "user","_id" : "5","_score" : null,"_source" : {"name" : "zhangsan","address" : "bei jing chao yang qu","age" : 29,"birthday" : "1988-10-12","interests" : "xi huan tingyinyue , changge , tiaowu"},"sort" : [29]},{"_index" : "lib3","_type" : "user","_id" : "4","_score" : null,"_source" : {"name" : "wangwu","address" : "bei jing hai dian qu qing he zhen","age" : 26,"birthday" : "1995-10-12","interests" : "xi huan biancheng, tingyinyue, lvyou"},"sort" : [26]},{"_index" : "lib3","_type" : "user","_id" : "3","_score" : null,"_source" : {"name" : "lisi","address" : "bei jing hai dian qu qing he zhen","age" : 23,"birthday" : "1998-10-12","interests" : "xi huan hejiu,duanlian, changge"},"sort" : [23]},{"_index" : "lib3","_type" : "user","_id" : "2","_score" : null,"_source" : {"name" : "zhaoming","address" : "bei jing hai dian qu qing he zhen","age" : 20,"birthday" : "1998-10-12","interests" : "xi huan hejiu, duanlian, changge"},"sort" : [20]}]} }?
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的ElasticSearch查询返回信息根据字段排序(英文检索)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql11导入数据_MySQL专题1
- 下一篇: c语言ascii码表数字,求教!我想显示