Apache solr filter based on array values Has anyone succeeded in filtering array values using Apache solr? I have nids as an array, programmatically I want to use the array to filter the solr based on the 'entity_id'.

I tried something like

  $solr = apachesolr_get_solr();
  $query = apachesolr_drupal_query("custom", array('q' =&gt; ''),'sort_label asc', 'search/site');
  $query-&gt;addFilter('entity_id', '[10915 11013]');
  $response = $query-&gt;search();


But I don't get the desired results, somewhere the apachesolr_search or apachesolr module seems to be adding quotes to the filter values something like 

webapp=/solr path=/select params={sort=sort_label+asc&amp;start=0&amp;q=&amp;json.nl=map&amp;wt=json&amp;fq=entity_id:"[10915+11013]"&amp;rows=10} status=500
I finally figured it out. Just a small change to what Clive suggested will solve the issue.

$query-&gt;addParam('fq', "entity_id:(10915 OR 11013)");


The above code gives me the expected response, i.e., result of node 10915 and 11013.

Hope this helps :)