Solr负提升 [英] Solr negative boost

查看:119
本文介绍了Solr负提升的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究在发布期间取消对一组文档进行打扰的可能性 查询时间.在我的应用程序中,当我搜索例如我想要「偏好设定」 取消使用ContentGroup:"Developer"或换句话说标记的内容, 将这些内容推回原先的顺序.这是要抓住的地方.我有以下 在查询字段上权重并在源代码上增强查询

I'm looking into the possibility of de-boosting a set of documents during query time. In my application, when I search for e.g. "preferences", I want to de-boost content tagged with ContentGroup:"Developer" or in other words, push those content back in the order. Here's the catch. I've the following weights on query fields and boost query on source

qf=text^6 title^15 IndexTerm^8

如您所见,标题具有较高的权重.

As you can see, title has a higher weight.

现在,一堆用 ContentGroup:"Developer" 标记的内容由一个 标题,例如"Preferences.material" "Preferences属性" "Preferences.graphics" .标题的增加将这些文档推到了 最佳.

Now, a bunch of content tagged with ContentGroup:"Developer" consists of a title like "Preferences.material" or "Preferences Property" or "Preferences.graphics". The boost on title pushes these documents at the top.

我正在寻找是否有一种方法可以消除所有 标记为ContentGroup:"Developer"的项目,与出现的术语无关 文字或标题.我尝试过类似的方法,但没有任何区别.

What I'm looking is to see if there's a way to deboost all documents that are tagged with ContentGroup:"Developer" irrespective of the term occurrence is text or title. I tried something like, but didn't make any difference.

Source:simplecontent^10 Source:Help^20 (-ContentGroup-local:("Developer"))^99

我正在使用edismax查询解析器.

I'm using edismax query parser.

任何指针将不胜感激.

Any pointers will be appreciated.

谢谢

Shamik

推荐答案

您上次尝试时遇到了麻烦,但是您必须从*:*开始,这样才能真正从中减去文档.然后可以增强生成的文档集(那些文档与查询不匹配).

You're onto something with your last attempt, but you have to start with *:*, so that you actually have something to subtract the documents from. The resulting set of documents (those not matching your query) can then be boosted.

来自 Solr相关性常见问题解答

如何给与查询匹配的文档带来负面(或非常低)的提升?

不支持真正的负提升,但是您可以在查询子句中使用非常低"的数字提升值.通常,使人困惑的问题是低"提升仍然是提升,它只能提高匹配文档的分数.例如,如果您想查找所有与"foo"或"bar"匹配的文档,但对与"xxx"匹配的文档进行打分,那么您可能会想尝试...

True negative boosts are not supported, but you can use a very "low" numeric boost value on query clauses. In general the problem that confuses people is that a "low" boost is still a boost, it can only improve the score of documents that match. For example, if you want to find all docs matching "foo" or "bar" but penalize the scores of documents matching "xxx" you might be tempted to try...

q = foo^100 bar^100 xxx^0.00001 # NOT WHAT YOU WANT

...但是,这仍然有助于匹配所有三个子句的文档的得分高于仅匹配前两个子句的文档的得分.伪造负增长"的一种方法是对所有不匹配匹配的事物进行大幅度增强.例如...

...but this will still help a document matching all three clauses score higher then a document matching only the first two. One way to fake a "negative boost" is to give a large boost to everything that does not match. For example...

q = foo^100 bar^100 (*:* -xxx)^999

注意:使用(e)dismax时,人们有时希望指定一个纯否定查询,并在"bq"参数中大幅度提高(因为Solr通过添加隐式":"-但这不适用于" bq,因为通过" bq指定的查询是如何直接添加到主查询中的.您需要明确...

NOTE: When using (e)dismax, people sometimes expect that specifying a pure negative query with a large boost in the "bq" param will work (since Solr automatically makes top level purely negative positive queries by adding an implicit ":" -- but this doesn't work with "bq", because of how queries specified via "bq" are added directly to the main query. You need to be explicit...

?defType=dismax&q=foo bar&bq=(*:* -xxx)^999

这篇关于Solr负提升的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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