Skip to content

Commit 32d7151

Browse files
committed
Optimized scout search with smart search
1 parent 6fb8571 commit 32d7151

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/QueryDataTable.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,23 @@ protected function globalSearch(string $keyword): void
853853
});
854854
}
855855

856+
/**
857+
* Perform multi-term search by splitting keyword into
858+
* individual words and searches for each of them.
859+
*
860+
* @param string $keyword
861+
* @return void
862+
*/
863+
protected function smartGlobalSearch($keyword): void
864+
{
865+
// Try scout search first & fall back to default search if disabled/failed
866+
if ($this->applyScoutSearch($keyword)) {
867+
return;
868+
}
869+
870+
parent::smartGlobalSearch($keyword);
871+
}
872+
856873
/**
857874
* Append debug parameters on output.
858875
*

0 commit comments

Comments
 (0)