0

I created a user interface for search operation. In that user need to select the filter values and also he can search for a particular keyword.

For eg. If the user selects filter by country(eg.USA and also INDIA) and search for the keyword "Street", I have to get the result that contains "street" and also country should be "USA" or "INDIA" .

How to achieve this using solr so that user may select any number of filter value for the same field?

**http://localhost:8983/solr/acc_sea/select?fl=Address_Line_1,Address_Line_2,City,State,Zip,Country,Account_Name,Account_Code,Phone_Number,BIN_Number&fq=Country:"+filtervalue+"&indent=on&q="+searchParam+"&wt=json**

We exactly don't know how many filter values user gives. How solr analyses and gives the result?

Savitha
  • 11
  • 1
  • 2

1 Answers1

1

Solr supports boolean queries. i.e. you can safely use Country:(USA OR INDIA) .

Taking a look to the performance it is likely you want to cache separately these results sets. In that case you may prefer to use : Country: filter(Country:USA) OR filter(Country:INDIA) [1]

[1] https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser#TheStandardQueryParser-DifferencesbetweenLuceneQueryParserandtheSolrStandardQueryParser