George Murphy
George Murphy

Reputation: 1087

Getting OR instead of AND in multiple word query search

When I do a query on a single word my faceting

works well however when I search multiple word Solr treats each word as OR. For example linear algebra, returns linear and then algebra.

Upvotes: 2

Views: 451

Answers (1)

Ansari
Ansari

Reputation: 8218

If you want to change the default settings, you can change it in schema.xml. Find the line that looks like this:

<solrQueryParser defaultOperator="OR"/>

and change the OR to AND.

If you don't want to change the global default or you don't have access to it, you can use local params and prefix {!q.op=AND} to the query you send across to Solr.

Upvotes: 3

Related Questions