SOLR过滤器查询与主查询 [英] SOLR filter-query vs main-query

查看:208
本文介绍了SOLR过滤器查询与主查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SOLR文档指出过滤器查询,不像主要查询,不影响文档分数。任何人都可以解释这是什么意思,最好是一个例子。



谢谢。

解决方案

一个FilterQuery只存储文档IDS。这使得应用过滤器来包含/排除文档的速度非常快。很好的例子是从基于国家,产品类型,可用性等搜索过滤产品。
$ b一个正常的查询可以执行完全相同的功能,但它有一个非常复杂的评分系统来确定相关性。我相信该文档指出评分只在主查询上完成,而不是在过滤器查询上完成。所以,我可以查询:

  description:Kohler AND productType:Toilet 

或者我可以查询:

 描述:Kohler 
带有productType的FQ:厕所

结果是一样的,但分数会有所不同。此外,如果您在一天中收到许多针对 productType:Toilet 的不同查询,则会缓存FilterQuery,从而使整个查询时间更快。


SOLR docs, state that filter queries, unlike the main query, do not influence the document score. Can anyone explain what does this mean exactly, preferably with an example.

Thanks.

解决方案

A FilterQuery ONLY stores document IDS. This makes it very fast to apply the filter to include/exclude documents. Good examples of this are when filtering products from search based on Country, Product Type, Availability, etc.

A normal query can perform the exact same function, but it has a very complex scoring system to determine "relevance". I believe the documentation is indicating that scoring is only done on the Main Query, not on the Filter Query. This should also increase query speed.

So, I can query for:

description:Kohler AND productType:Toilet

Or I can query for:

description:Kohler
with a FQ of productType:Toilet

The results would be the same, but the scores would be different. Also, if you get many different queries throughout the day that are for productType:Toilet, the FilterQuery would be cached making the overall query time faster.

这篇关于SOLR过滤器查询与主查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆