ElasticSearch在索引中的位置 [英] ElasticSearch position in index
问题描述
例如,我建立一个包含两个元素的索引:
Element1,得分:8
Element2,得分:7
Element3,得分:10
查询Element2我想获得位置= 3
Elasticsearch在实际收集结果之前不知道该地点它收集结果只能将其发送回客户端。所以,在找到你要查找的文档之前,真的没有办法得到这个地方,而没有经过结果。如果将所有这些结果发送给客户端不适合您,则可以编写一个将在服务器端执行的插件。
I'm considering the use of Elasticsearch to build a rank. If I index a list of elements that is ordered according to a score. Can I query by an element name and get its position on the Index?
e.g i build an index with two elements:
"Element1", score: 8 "Element2", score: 7 "Element3", score: 10
When I query by "Element2" I would like to obtain position = 3
Elasticsearch doesn't know the place until it actually collects results and it collects results only to send them back to client. So, there is really no way to just get the place without going through results until you find the document you are looking for. If sending all these results to client doesn't work for you, you can write a plugin that will do it on the server side.
这篇关于ElasticSearch在索引中的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!