After integrating this module and while performing search for cck fields values,the search doesnt display any results.
(for example if we have node with 'company' as cck field having value as "technology solutions"), while performing search for the term "tech" no results are displayed. search is working only for complete word but not for partial word.

Please suggest on, how to get results if search is performed on partial word even?

Comments

mike.davis’s picture

Issue summary: View changes

I have come up against this same problem. Looking at the actual Solr query it is setting the 'q' param to be the word that a user is searching for which will only match on that exact word. To make the Solr search work on words that contain the search word you can add an asterisk to the 'q' param.

I have done this by using hook_apachesolr_query_alter:

/**
 * Implements hook_apachesolr_query_alter().
 */
function MY_MODULE_apachesolr_query_alter(DrupalSolrQueryInterface $query) {
  // Update the Solr query to do a partial word search.
  $search_term = $query->getParam('q');
  $query->replaceParam('q', $search_term . '*');
}

It would be nice to have an option within the page search settings to be able to search on partial words when doing a search. I will try and have a look to see if I can get this working so it configurable against the search pages defined and provide a patch.