I am working on apachesolr search module.
I want to implement wildcard search I have used hook_apachesolr_query_prepare()
function to modify apachesolr query
but it is not working can any one give me solution.
I have implemented code like this.
I have taken reference from here : https://www.drupal.org/project/apachesolr/issues/1539284
function custommodule_apachesolr_query_prepare(DrupalSolrQueryInterface &$query, &$caller) {
$search = '';
$keywords = preg_split("/[\s,]+/", $query->getParam('q'));
foreach ($keywords as $keyword) {
$search .= '*' . strtolower($keyword) . '* ';
}
$query->addParam('defType', 'edismax');
$query->replaceParam('q', $search);
}
ENV: Drupal 7.60
| Solr 3.X
solrconfig.xml
from3.X
folder, add<requestHandler name="drupal" class="solr.SearchHandler" default="true">
mention in the issue page, because it's not added by default in the config example come withsearch_api_solr
module.