Solr AND operator not working

我的未来我决定 提交于 2019-12-13 06:19:55

问题


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

returns docid 187095

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

returns docid 187095

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

returns no result.

Am I not applying AND correctly ?


回答1:


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]


来源:https://stackoverflow.com/questions/25051388/solr-and-operator-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!