I have implemented solr search o my site. When I search the query "Red Shoes", it is showing results for both Red and shoes. But I wants solr to show those records which contains both keywords "Red" and "Shoes". It it related to whitespace tokenizer ??. Thanks in advance.
Asked
Active
Viewed 1,018 times
1 Answers
0
You need to set the default operator. By default, it is OR
, just like in the core Lucene standard query parser. You can set it to AND
in your schema with:
<solrQueryParser defaultOperator="AND"/>
Or in your query string with q.op
, like:
{!lucene q.op=AND df=text}red shoes

femtoRgon
- 32,893
- 7
- 60
- 87
-
1Absolutely correct, but to be more specific, [LocalParams](http://wiki.apache.org/solr/LocalParams) are the way to go here. The version in schema.xml is being considered for deprecation (see [SchemaXml](http://wiki.apache.org/solr/SchemaXml#Default_query_parser_operator) for more information). – Dawngerpony May 09 '13 at 07:22