gpt4 book ai didi

Elasticsearch 根据数字与查询的接近程度进行评分

转载 作者:行者123 更新时间:2023-11-29 02:52:14 26 4
gpt4 key购买 nike

我想根据数字与查询的接近程度对我的文档进行评分。鉴于我有两个文档 document1.field = 1document2.field = 10,查询 field = 3 然后我想要 document1 ._score > document2._score。或者换句话说,我想要类似数字的模糊查询。我将如何实现这一目标?用例是我想支持价格查询(精确或范围),但想要对不完全在边界内的东西进行排名。

最佳答案

您正在寻找Decay functions :

Decay functions score a document with a function that decays depending on the distance of a numeric field value of the document from a user given origin. This is similar to a range query, but with smooth edges instead of boxes.

关于Elasticsearch 根据数字与查询的接近程度进行评分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15880103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com