search api autocomplete withour accent, and splitting numbers (fruhstuck40)

This commit is contained in:
2021-10-07 22:44:32 +02:00
parent dd22a6e143
commit aca756e64d
5 changed files with 119 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Component\Utility\Tags;
use Drupal\Component\Utility\Unicode;
// use Drupal\Component\Utility\Unicode;
use Drupal\search_api\Entity\Index;
@@ -24,7 +24,8 @@ class FormAutocomplete extends ControllerBase {
// Get the typed string from the URL, if it exists.
if ($input = $request->query->get('q')) {
$typed_string = Tags::explode($input);
$typed_string = Unicode::strtolower(array_pop($typed_string));
// $typed_string = Unicode::strtolower(array_pop($typed_string));
$typed_string = mb_strtolower(array_pop($typed_string));
// \Drupal::logger('materio_sapi')->notice($typed_string);
$index = Index::load('autocomplete');