DisMax 解析用户查询,q 或 fq 过滤结果

发布于 2025-01-04 06:39:18 字数 248 浏览 2 评论 0原文

我使用 PHP 来获取用户搜索查询,并通过 SOLR 在特定字段“关键字”上运行它们,该字段本质上包含文档中所有数据的串联。

我还在该查询上使用方面来进一步深入了解结果集。

我的问题:

  1. 我应该使用 SOLR DisMax 来解析所有用户查询吗?
  2. 进行分面深入搜索是否被认为是不好的做法 直接使用关键字搜索进行标准查询或者我应该使用 filterqueries 来过滤原始标准查询及其结果集?

I am using PHP to grab user search queries and running them through SOLR on a specific field "keyword" which contains essentially a concatenation of all of the data in the document.

I am also using facets on this query to further drill down on the result set.

My questions:

  1. Should I be using SOLR DisMax to parse ALL user query?
  2. Is it considered bad practice to put the faceted drill-down searches
    directly into a standard query with the keyword search OR should I be using
    filterqueries to filter the original standard query and it's resultset?

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

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

发布评论

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

评论(2

冰雪之触 2025-01-11 06:39:18

我会使用eDisMax,它基本上更强大、更宽容(这意味着它通常不会为格式错误的查询返回错误)。

我强烈建议使用过滤查询来过滤结果(fq< /code> 参数)例如单击某个方面条目,主要出于以下原因:

  • 过滤器查询不会影响 solr 分数
  • 过滤器查询速度更快,因为通过 过滤器缓存

I would use eDisMax, it's basically more powerful and more tolerant (it means it usually doesn't return errors for malformed queries).

I'd strongly recommend to use filter queries to filter your results (fq parameter) clicking for example on a facet entry, mainly for these reasons:

  • filter queries don't influence the solr score
  • filter queries are faster, since cached independently from the main query through the filter cache
提笔落墨 2025-01-11 06:39:18

查询解析器的选择取决于您的要求。 Should_I_use_the_standard_or_dismax_Query_Parser

Dismax/Edismax 允许您在多个字段上查询和提升,但有一些限制操作员的处理及其支持。
如果您查询单个字段,标准查询解析器可以满足要求。

正如@javanna 提到的
您应该始终尝试使用过滤器查询来对抗关键字搜索,因为它允许 通过缓存支持进行过滤

The choice of query parser depends upon your requirement. Should_I_use_the_standard_or_dismax_Query_Parser

Dismax/Edismax allows you to query and boost on multiple fields, but has some limitations with handling of operators and their support.
If you are querying on a single field, Standard query parser can serve the requirement.

And as mentioned by @javanna
You should always try to use filter queries as against the search on the keywords, as it allows filtering with cache support.

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