0

I've a Solr index with all documents having three fields - name, address and other_addresses. I want to search for a person having name say 'Tom Cruise' and Address '3rd Avenue 23rd Floor New York, NY 10016'.

Now I want to search name in only name field having its some specific boost value and minimum match value as well. Also, address need to be searched in both address and other_addresses, with different mm and boost values.

Can someone help me in writing edismax query on any other way around for Solr?

I'm doing something like :

select?debugQuery=on&defType=edismax&fl=*%20score&mm=70%25&q=name%3A(Rita%20Suman%20Shinde%20Near)%20address%3A(Gunjan%20Talkies%20Yerwada%20Pune)%20other_addresses%3A(Gunjan%20Talkies%20Yerwada%20Pune)&qf=name%20other_addresses%20address&stopwords=true

but not able to figure how to give different mm values.

Pierre Mallet
  • 7,053
  • 2
  • 19
  • 30
Rajat Goel
  • 2,207
  • 17
  • 35

1 Answers1

2

You can use LocalParams to compose several dismax queries into one, and each of those subqueries can have its own dismax parameters. For example:

q={!dismax qf=name mm=2 v=$q1}^2.0 {!dismax qf=address1 mm=4 v=$q2}^1.5 {!dismax qf=other_address mm=4 v=$q2}^1.0
q1=Tom Cruise
q2=3rd Avenue 23rd Floor New York, NY 10016