2

I'm new to elasticsearch and tire, and I'm struggling to work out how to expose the scores of the search results.

Given a particular query string, I want to be able to do the following:

  • If there are multiple 'good' results (highly scored) => Send the user to page A (select between them)

  • If there is one 'good' results => Send the user to page B (proceed using the item found)

  • If there are no 'good' results => Send the user to page C (drop-off page)

Is it possible to do this with tire? If so, how?

4

1 回答 1

1

有趣的问题。路由逻辑非常简单:看看返回了多少结果以及它们的分数(_score属性)是多少。

问题是,你怎么知道结果是“好”的。显然,您知道分数,但棘手的部分是计算或估计什么是好分数。例如,您可以使用custom_scoreboosting查询来操纵分数,但您如何知道“好”值是多少?

于 2012-12-12T16:41:36.943 回答