add condition in apache solr serch query
You can use hook_apachesolr_query_alter()


  Alter the query after it's prepared and cached.


Example from the docs page

function hook_apachesolr_query_alter($query) {
  // I only want to see articles by the admin.
  //
  // NOTE: this "is_uid" filter does NOT refer to the English word "is"
  // It is a combination of flags representing Integer-Single, which is
  // abbreviated with the letters i and s.
  //
  // @see the &lt;dynamicField&gt; definitions in schema.xml or schema-solr3.xml
  $query-&gt;addFilter("is_uid", 1);

  // Only search titles.
  $query-&gt;replaceParam('qf', 'label');
}