如何检索 Solr 搜索的所有适用方面字段

发布于 2024-12-07 04:20:35 字数 236 浏览 0 评论 0原文

我正在尝试在网站上使用 Solr 进行分面搜索。

当用户发出搜索查询时,我查询 Solr 并检索然后可以显示的搜索结果。

我的问题是 - 如何找出哪些构面字段和术语适用于搜索结果?

要明确 - 不同类别的产品具有不同的构面字段,我想找到一种方法将其带回来与已返回的搜索结果最相关的方面字段。我不想指定字段 - 我希望 Solr 为我识别相关字段。

提前致谢!

I'm trying to use Solr for faceted-seaarch on a website.

When a user fires off a search query, I query Solr and retrieve the search results which can then be displayed.

My question is - how do I find out which facet fields and terms are applicable to the search results?

To be clear - different categories of products have different facet fields and I want to find a way to bring back the most relevant facet fields for the search results that have been returned. I don't want to have to specify the fields - I'd like Solr to identify the relevant ones for me.

Thanks in advance!

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

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

发布评论

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

评论(2

揽清风入怀 2024-12-14 04:20:35

我建议查看 Solr Wiki 上的所有 简单 Facet 参数,尤其是底部,因为它们将向您展示为查询配置分面结果的所有可能方法。

如果我正确理解你的问题......默认情况下,分面只会根据结果集中的文档返回分面/计数。然而,为了使这些与搜索更相关,您应该将facet.mincount设置为默认值0以外的值。例如。 &facet.mincount=1。但是,请再次参阅文档,了解其工作原理以及如何应用于您的场景。

I would recommend looking over all of the Simple Facet Parameters on the Solr Wiki, especially the examples at the bottom as they will show you all of the possible ways that you can configure the faceting results for your queries.

If I am understanding your question correctly... by default faceting will only bring back facets/counts based on the documents in the result set. However to make those more relevant to the search, you should set the facet.mincount to something other than the default value of 0. eg. &facet.mincount=1. But, again please refer to the documentation on how this works and can be applied to your scenario.

梦途 2024-12-14 04:20:35

我有同样的问题。

我最终所做的是查询 Solr 以获得给定查询的前 50 个命中,然后收集这些产品上设置的属性的名称。然后,我执行另一个查询,将方面字段设置为我第一次找到的产品属性。

Im having the same problem.

What I eventually did was to query Solr for the top 50 hits for a given query and then collect the names of the properties set on those products. I then do another query with the facet fields set to the product properties I found first time around.

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