0

I am using Solr search with drupal.Its working fine on my site but the problem is i needed the search to be a specific to the searched content. If i searched for "assembly and key",the search result showing all results which is having the world assembly and key also.

But I needed the result like wherever this particular word is found not the separate. when i search for "assembly and key" it is giving me around 55 results and when i am searching "assembly+and+key", it is giving only 1 result which is i want. So please let me know how to do it.

I have tried to change solr/conf/schema.xml for AND operator also tried to add code in apachesolr module file for changing the mm parameter but it doesn't work.

1
  • Finally i didnt found any good solution.So i have done it through drupal coding. i have added OP='AND' in Solr_Base_Query.php also changed mm=100% and op=AND. – Akshay Sawant Aug 9 '13 at 12:12
0

You need not to edit the Solr_Base_Query.php file just add the following line of the code in your module

function modulename_apachesolr_query_prepare($query){
$query -> addParam('q.op', 'OR');

}

1
  • thanks for the answer i already added it which is working fine now. – Akshay Sawant Jan 7 '14 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.