按相关性和类别对 solr 结果进行评分

发布于 2024-12-21 02:16:00 字数 325 浏览 5 评论 0原文

我们使用 Solr 1.4 来生成用户查询的结果。结果是从包含大约 500k 文档的索引中获取的。索引不断更新新文档,旧文档也会过期。

结果页面是按相关性(分数)排序的文档列表,由 solr 根据用户的查询自动计算。每个文档都属于一个类别(例如工程、金融、管理、数学等),并且类别 ID 由 Solr 存储和索引。

我们想要实现的目标是根据相关性对文档进行排序,同时以某种方式进行加权,以便至少结果的第一页(10,20 或 50)包含来自尽可能多类别的文档以及尽可能少的文档同一类别是连续的。

我们进行了很多搜索,但还没有想出任何可行的方案。

非常感谢您的任何想法。 吉克

We are using Solr 1.4 to produce results for user queries. The results are fetched from an index containing approximately 500k documents. The index is constantly being updated with new documents and old documents expire.

The results pages are lists of documents sorted by relevancy (score), automatically calculated by solr depending on the user's query. Each document belongs to a single category (e.g engineering, finance, administration, maths etc) and the category id is stored and indexed by Solr.

What we want to achieve is for documents to be sorted on relevancy, but also be weighted in some way so that at least the first page of results (10,20 or 50) contains documents from as many categories as possible and as few documents of the same category are consecutive.

We've searched a lot but have not managed to come up with any feasible scenario.

Many thanks in advance for any ideas.
GK

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谎言月老 2024-12-28 02:16:00

据我所知,这在 Solr 中是不可能的。我的意思是,如果搜索词比其他任何内容更适用于工程项目,您将需要根据搜索结果以不同的方式人为地提升其他类别。

您可以在最新版本中使用字段折叠执行类似的操作。也就是说,您只会从某个类别中获得 X 次点击,然后获得一个指向“显示更多类似内容”的链接。

或者,您可以进行多次搜索,每个类别一次搜索,然后自己“混合”它们。

To the best of my knowledge, this isn't possible in Solr. I mean, what if the search term is much more applicable to engineering items than anything else, you would need to artificially boost the other categories in different ways based on the search result.

You can do something similar to this in the latest version using field collapsing. I.e. you will only get an X number of hits from a category and then a link to 'show more like this'.

Alternatively, you could do several searches, one for each category and 'blend them' yourself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文