yabhq / laravel-scout-mysql-driver

Laravel Scout MySQL Driver
MIT License
522 stars 113 forks source link

Limitation of results by relevance #41

Closed abufalbo closed 5 years ago

abufalbo commented 7 years ago

Hi, is it posible to limit of results by relevance? Something like:

SELECT *, MATCH(name,title,text) AGAINST('some text' IN BOOLEAN MODE) AS relevance 
FROM `search_articles`
WHERE MATCH(name,title,text) AGAINST('some text' IN BOOLEAN MODE) 
HAVING relevance > 10 
ORDER BY relevance DESC

Thanks

mikerockett commented 6 years ago

This would be a great addition — in need of this myself...

msonowal commented 6 years ago

@abufalbo Please send a PR

AurelienMendes commented 5 years ago

The PR #91 may partially help you ... since the Models in the result collection will have now the relevance information as an attribute so that you we be able to filter on this attribute (but in PHP part)