Skip to content

Commit

Permalink
Fix Solr suggestions search
Browse files Browse the repository at this point in the history
  • Loading branch information
rominail committed Oct 7, 2024
1 parent 8d54e45 commit 6750ba3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/VuFind/src/VuFind/Autocomplete/Solr.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

namespace VuFind\Autocomplete;

use IntlChar;
use function count;
use function is_array;
use function is_object;
Expand Down Expand Up @@ -180,7 +181,7 @@ protected function mungeQuery($query)
// Modify the query so it makes a nice, truncated autocomplete query:
$forbidden = [':', '(', ')', '*', '+', '"', "'"];
$query = str_replace($forbidden, ' ', $query);
if (!str_ends_with($query, ' ')) {
if (IntlChar::isalpha(substr($query, -1))) {
$query .= '*';
}
return $query;
Expand Down

0 comments on commit 6750ba3

Please sign in to comment.