Solr AND运算符不起作用 [英] Solr AND operator not working

查看:105
本文介绍了Solr AND运算符不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://localhost:8080/products/select?indent=on&q=text:30MM X 533MM Abrasives&fl=*,[docid]

返回docid 187095

returns docid 187095

http://localhost:8080/products/select?indent=on&q=textfields:30MM X 533MM Abrasives&fl=*,[docid]

返回docid 187095

returns docid 187095

http://localhost:8080/products/select?indent=on&q=textfields:30MM X 533MM Abrasives AND text:30MM X 533MM Abrasives&fl=*,[docid]

不返回任何结果.

我不能正确申请AND吗?

Am I not applying AND correctly ?

推荐答案

如果您在查询中使用字段化数据并且未使用双引号(),则在该字段中搜索的唯一单词是第一个单词.例如,在您的第一个请求中,它将在文本"字段中查找关键字30MM,并在默认字段中查找其余关键字.

If you use fielded data in your query and you don't use double quotes ("), the only word being searched in that field is the first one. For example, in your first request, it looks for the keyword 30MM in the "text" field, and for the rest of the keywords in the default field.

在您的示例中,我认为如果您按以下方式进行查询应该可以:

In your example, I think that if you make the query as follows should work:

http://localhost:8080/products/select?indent=on&q=textfields:"30MM X 533MM Abrasives" AND text:"30MM X 533MM Abrasives"&fl=*,[docid]

这篇关于Solr AND运算符不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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