1
votes

I've seen advanced search like on google advance search. But is it possible to implement such advance search with solr search? My application is in java. I need to implement 3 kind of advance searches.. 1) include these words 2) match exact phrase 3) do not include these keywords I'm using solr 4.2 and lucene 4.2

1

1 Answers

2
votes

Solr does provide the ability to Search for various combinations.

  1. Include these words - Solr allows to search for words not in entirely within the document. The match operator can be set to OR (search for any words) instead of AND (all the words).
    Also, if you use Edismax query parsers, you would be able to configure mm parameter to specify the conditions for word match.

  2. Match exact phrase - Solr allows to use double quotes "" to indicate a Exact match search.

  3. Do Not Include these Keywords - Solr supports boolean operators and with NOT (-) keywords can be specified which should not be in the documents resulted from the search.
    e.g. cat NOT dog will return documents with cat but NOT dog in the fields searched for.