Change the Solr Operator to OR Am working with drupal search api solr module am trying to get it to work with the OR Operator so if i do a search for "David Smith" it should show results for both "David" and "Smith" does anyone have ideas on how to achieve this
By default, the apachesolr Drupal module is set to do an AND search.  However, you can change that in one of two ways:


Implement a custom module that alters the queries sent to apachesolr.  All you'd need is to implement the apachesolr_query_alter hook.

 &lt;?php
 function HOOK_apachesolr_query_alter($query) {
   // Force an OR keyword search.
   $params['mm'] = '100%';
 }
 ?&gt;



More details can be found on this drupal.org documentation page: http://drupal.org/node/1159424


The second thing you can do is modify the deafaultOperator from "AND" to "OR" in apachesolr's schema.xml file.  You should be able to find that in your modules/apachesolr/solr-conf folder.  That setting should be towards the end of the file

&lt;!-- SolrQueryParser configuration: defaultOperator="AND|OR" --&gt;
&lt;solrQueryParser defaultOperator="AND"/&gt;   // change to OR here



With this second one, just be careful.  You don't want to make this change to your schema file and then forget and have it replaced later when you update your module or something like that.  Just by searching now, I can see there is this rather unstable module that exposes some of the configuration options of the schema file in the User Interface: http://drupal.org/project/apachesolr_confgen, but I'm not sure I'd choose to use that...

Hope one of these helps!