0

I am using Solr version 5 for searching data. I am using below query to which returns results even single keyword is matched.

http://localhost:8983/solr/document/select?q=keyword1+keyword2&wt=json

Can anyone suggest me query to fetch results only if 2 or more keywords matched.

Thanks.

Kalpesh
  • 83
  • 2
  • 6

2 Answers2

1

Use the dismax mm (minimum should match) parameter

q=keyword1+keyword2&defType=dismax&mm=2&wt=json
femtoRgon
  • 32,893
  • 7
  • 60
  • 87
0

In your solrconfig.xml, change the default value of q.op to AND.

<str name="q.op">AND</str>
Anand
  • 81
  • 3