简体   繁体   English

SOLR 包含语法的提升查询

[英]SOLR boost query with contain syntax

in my solr call i want to boost all queries that have the word "mobile" in the longtext.在我的 solr 电话中,我想增加所有在长文本中包含“移动”一词的查询。

My call looks like this:我的电话看起来像这样:

&q=*my_query*&defType=edismax&qf=xtitleLow_stringS^20++xartnumLow_stringS&ps=2&bq=xtitleLow_stringS:(*mobile*)^40

when i use the Boost query like this:当我像这样使用 Boost 查询时:

&bq=xtitleLow_stringS:"mobile"^40 &bq=xtitleLow_stringS:“手机”^40

it will work for fulltext but i just want to boost a query that contains it.它适用于全文,但我只想增强包含它的查询。 I thought i can use the "*" contain to especially search for it.我想我可以使用“*”包含来专门搜索它。 But it doesen't work, is there a mistake in my syntax?但它不起作用,我的语法有错误吗?

thank you!谢谢你!

The syntax of the boost query seems incorrect in my opinion.在我看来,boost 查询的语法似乎不正确。 The "*" wildcard can only be used in a query when preceded by the word "text". “*”通配符只能在前面有单词“text”的查询中使用。

eg &bq=xtitleLow_stringS:text:mobile^40例如&bq=xtitleLow_stringS:text:mobile^40

To boost all queries that contain the word "mobile", you can write as:要提升所有包含“移动”一词的查询,您可以这样写:

&bq=xtitleLow_stringS:mobile^40

This should boost any query that contains the word "mobile" in the xtitleLow_stringS field by 40 factor.这应该将 xtitleLow_stringS 字段中包含单词“mobile”的任何查询提高 40 倍。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM