Solr:如何在字段中搜索短语?
Solr: How do I search for a phrase in a field?
我正在阅读 the documentation 并且看到了这个:
For example, suppose an index contains two fields, title and text,and that text is the default field. If you want to find a document called "The Right Way" which contains the text "don't go this way," you could include ... the following terms in your search query:
title:"Do it right" AND go
Since text is the default field, the field indicator is not required; hence the ... query above omits it.
The field is only valid for the term that it directly precedes, so the query title:Do it right
will find only "Do" in the title field. It will find "it" and "right" in the default field (in this case the text field).
这让我觉得很奇怪,我该如何在标题中搜索词组 "Do it right"?
我继续阅读并在标题为 "Grouping Clauses within a Field" 的部分中找到了答案。你可以使用这个:
title:("Do it right") AND go
我正在阅读 the documentation 并且看到了这个:
For example, suppose an index contains two fields, title and text,and that text is the default field. If you want to find a document called "The Right Way" which contains the text "don't go this way," you could include ... the following terms in your search query:
title:"Do it right" AND go
Since text is the default field, the field indicator is not required; hence the ... query above omits it. The field is only valid for the term that it directly precedes, so the query
title:Do it right
will find only "Do" in the title field. It will find "it" and "right" in the default field (in this case the text field).
这让我觉得很奇怪,我该如何在标题中搜索词组 "Do it right"?
我继续阅读并在标题为 "Grouping Clauses within a Field" 的部分中找到了答案。你可以使用这个:
title:("Do it right") AND go