ElasticSearch:提升人气和日期

时间:2015-11-13 18:29:33

标签: elasticsearch

https://www.elastic.co/guide/en/elasticsearch/guide/current/boosting-by-popularity.html一样,我想通过他们的受欢迎程度提高我的搜索结果。

但我也希望提升最新版本。

我有想法将此请求与RobMaters:Is it possible to boost 'newest' items using elasticsearch? (FOQElasticaBundle)

结合起来

我觉得以某种方式提高人气(fiels价值因素函数)和另一个(直接在范围查询中)的日期 - >有点奇怪。有没有好的"这样做的方法?

(如果它有用,我使用java api)

1 个答案:

答案 0 :(得分:1)

这已经很老了,但是对于遇到此问题的其他人,我建议您看一下以下资源:https://www.voxxed.com/2014/12/advanced-scoring-elasticsearch/

您可以将function_score应用于查询,并提供可以根据字段的值进行增强的功能。 gauss函数对于日期而言是一个不错的选择,而field_value_factor可能对于流行度衡量而言是很好的。也没有什么可以阻止您将两者结合在一起。