$data['indexer'
] =
$indexer->
getName();
$data['index'
] =
(string) $index;
$mapped[$indexer->
getEntity()] =
$data;
} return $mapped;
} private function buildSearch(string
$term, int
$limit): Search
{ $search =
new Search();
$splitTerms =
explode(' ',
$term);
$lastPart =
end($splitTerms);
// If the end of the search term is not a symbol, apply the prefix search query
if (preg_match('/^[a-zA-Z0-9]+$/',
$lastPart)) { $term =
$term . '*';
} $query =
new SimpleQueryStringQuery($term,
[ 'fields' =>
['text'
],
]);