Suche: Volltext-Index + Fix fuer doppelte Alpine-Instanz
Archiv-Suche lief auf grossen Datenbestaenden langsam und war im Browser komplett tot: app.js startete ein eigenes Alpine, Livewire injizierte zusaetzlich seins - der DOM-Morph brach mit "Alpine.transaction is not a function" ab (keine Rubrik klickbar, Suchbegriff nicht aenderbar). - app.js buendelt jetzt Livewire + Alpine aus livewire.esm, @livewireScriptConfig im Web-Layout stoppt die Auto-Injektion - MySQL-Volltext-Index (Boolean-Mode, +wort*) statt LIKE ueber alles; LIKE-Fallback fuer SQLite-Tests und kurze Tokens - Firmen-/Rubrik-Treffer als ID-Listen statt orWhereHas (OR + EXISTS hebelte den Volltext-Index aus) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b3780e0fea
commit
db65c2ed7d
6 changed files with 178 additions and 16 deletions
|
|
@ -74,18 +74,7 @@ new class extends Component
|
|||
$query = $this->baseQuery();
|
||||
|
||||
if (mb_strlen($term) >= 2) {
|
||||
$query->where(function (Builder $inner) use ($term): void {
|
||||
$like = '%'.$term.'%';
|
||||
$inner
|
||||
->whereLike('title', $like)
|
||||
->orWhereLike('subtitle', $like)
|
||||
->orWhereLike('text', $like)
|
||||
->orWhereLike('keywords', $like)
|
||||
->orWhereHas('company', fn (Builder $company) => $company->whereLike('name', $like))
|
||||
->orWhereHas('category.translations', fn (Builder $translation) => $translation
|
||||
->where('locale', $this->language)
|
||||
->whereLike('name', $like));
|
||||
});
|
||||
$query->matchingSearchTerm($term, $this->language);
|
||||
}
|
||||
|
||||
if ($this->category !== '') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue