mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
22 lines
514 B
PHP
22 lines
514 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support;
|
|
|
|
/**
|
|
* Shared helpers for migrating Scout/MySQL boolean fulltext queries to the unified search engine.
|
|
*/
|
|
final class MetadataSearchLookup
|
|
{
|
|
/**
|
|
* Turn legacy "+word1 +word2" boolean query into a space-separated phrase for Manticore/ES.
|
|
*/
|
|
public static function normalizeBooleanSearchWords(string $searchwords): string
|
|
{
|
|
$s = str_replace('+', ' ', $searchwords);
|
|
|
|
return trim(preg_replace('/\s+/', ' ', $s));
|
|
}
|
|
}
|