Reputation: 23
I integrated Drupal 8 autocomplete module in my project. Its working fine. At the end search suggestion liss
, there is a link for view all results. When I click on the link, it goes to localhost/sampleapp/search/node?keys=test
. I got all the results for the keyword "test". But the problem is when the keyword is tes instead of test, I got no results. For example localhost /sampleapp/search/node?keys=tes
Upvotes: 2
Views: 1608
Reputation: 364
Acquia Search supports Solr N-Gram (partial-word search) text fields for Drupal 8 websites using the Search API module.
https://docs.acquia.com/acquia-search/relevant-results/partial/
Upvotes: 2
Reputation: 511
You can alter the queries provided by default. A similar action you can look into this as reference:
<?php
// Add alter hook to be able to change suggestions in your own module.
$alter_data = array(
'query' => $query,
'response' => $response,
'incomplete_key' => $incomplete_key,
'search' => $search,
);
drupal_alter('search_api_solr_autocomplete_suggestions', $alter_data, $suggestions);
?>
Hope this help.
Thanks.
Upvotes: 0