简体   繁体   English

SOLR 多字段查询

[英]SOLR Query with multible fields to search for

i've build a query in solr that looks like this:我在 solr 中构建了一个查询,如下所示:

https://local.solr.com/solr/select?omitHeader=true&wt=json&json.nl=flat&q=*:*&fq=xtitleLow_stringS:*1002*+OR+xartnumLow_stringS:*1002*

I want to search in solr with the query "1002" for results.我想使用查询“1002”在 solr 中搜索结果。 I didn't work it out how to search both fields with the normal query so i used the filter query.我没有弄清楚如何使用普通查询搜索这两个字段,所以我使用了过滤器查询。

But i can't boost the results so im kind of lost on this point.但我无法提高结果,所以我在这一点上有点迷茫。 How to build this as a query so i can boost some of the fields?如何将其构建为查询以便我可以增加一些字段?

thank you.谢谢。

You can try with the edismax handler provided by Solr. This allows to use list of fields to query.您可以尝试使用edismax提供的 edismax 处理程序。这允许使用字段列表进行查询。 It has option to give separate weights for each of the field for scoring them differently.它可以选择为每个字段赋予单独的权重,以便对它们进行不同的评分。

defType=edismax&q=1002&qf=xtitleLow_stringS^20 xartnumLow_stringS

The above query will search for 1002 in each of the mentioned fields.上面的查询将在每个提到的字段中搜索1002 It will be also adding a boost of 20x to any hits in the xtitleLow_stringS field.它还将为xtitleLow_stringS字段中的任何命中增加 20 倍的提升。

Please find the documentation link here for more details请在此处找到文档链接以获取更多详细信息

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

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