问题描述
我的ES索引文档为574,279,238.因此,查询数据库时必须处理很多结果.
I have an indexed ES of 574,279,238 documents. Since this, I have to manage lot of results when I query the DB.
是否有一种方法可以根据ASC排序的_score获得结果?我希望看到ES给我的X个最糟糕"结果...即使我有超过一百万个结果...
Is there a way to get results based on a ASC-sorted _score ? I would like to see the X "baddest" results ES gives me... even if I have more than 1 million results...
'sort'=> [{'_score':{'order':'asc'}}]
'sort' => [ {'_score' : {'order':'asc'} } ]
那是行不通的...
感谢您的帮助
推荐答案
是的,它可用.您可以摄取一些文档并进行检查.请按照我的说明进行按术语频率计数进行排序.
Yes, it is available. You may ingest some documents and check it. Please follow my instruction on sort result by term frequency count.
运行以下查询并找出预期结果:
Run following query and find out the expected result:
curl -XPOST "http://localhost:9200/movies/_search" -d'
{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "godfather"
}
}
}
},
"sort": [
{
"_score": {
"order": "asc"
}
}
]
}'
这篇关于有没有一种方法可以按ASC对elasticsearch _score进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!