How to change drupal facets solr query operator from "AND" to "OR"?
We're working on a drupal based Job Board and want our faceted search to provide results that match parts of selected facets.
E.g. the query has the facets "facet1", "facet2", "facet3", "facet4" - all from different taxonomies and thus in different facet blocks
standard behaviour is that all results necessarily contain ALL facets, but need to list results that only parts. E.g.:
- "facet1", "facet2", "facet3", "facet4"
- "facet1", "facet2", "facet4"
- "facet1", "facet3", "facet4"
- "facet3", "facet4"
- "facet1", "facet3"
- "facet3", "facet4
- "facet1"
How we can achieve this?
- similar question had been asked and not ansered:on:Drupal Job board: Faceted Search with "OR" operator, but sort results by most matching facet criterias/term count
Try this: Configure the display of your facet and under global settings change the operator from AND to OR.
To do this, go to admin/config/search/apachesolr/settings and click on Facets link under the configuration column, then in the operations column choose "configure display" for your facet, to edit your facet then scroll down and choose OR under the operator and save your configuration.