Closed matthewscalf closed 6 years ago
Search works like that by default, so all you need to do is provide whole phrase as one of the keywords for search:
$query->search(['john doe', 'john', 'doe'], false)
2nd param in this case means it is strict search, ie. it doesn't apply wildcard to each word (in mysql: %john%
, %doe%
) which is what you probably want in this case.
How hard would it be to add the function in where it give higher weights to searches that contain words combined together. Basically from the example package:
Prioritize matches containing "John Doe" above matches containing only "John" or "Doe".