Is elasticsearch non-deterministic?

巧了我就是萌 提交于 2021-02-18 12:31:06

问题


Does elasticsearch does not return the same results in the same order every time a query is executed because of its algorithm in calculating the score? Or is it something else? Is there a way to make it such that the results return in the same order everytime a query is executed? Is this normal?


回答1:


This might to do with the way elastic search calculates relevancy scores locally by default.

Try adding:

&search_type=dfs_query_then_fetch

to your query and see if that helps. This tells ES to calculate scores across the whole cluster.

More info:

http://www.elasticsearch.org/blog/understanding-query-then-fetch-vs-dfs-query-then-fetch/



来源:https://stackoverflow.com/questions/18091571/is-elasticsearch-non-deterministic

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!