tntsearch
tntsearch copied to clipboard
Searching multiple models in Laravel and ranking them
I've not been able to find any tutorial or guide that shows how to search multiple models together, with a query. In my application, I've a 'Thread' model and a 'Reply' model. When a user performs search, I need to search $thread->title
, $thread->body
and $reply->body
.
But then, I need to rank the results with relevance starting with the title, thread body and then reply-body.
Would really appreciate if someone could give me a pointer in the right direction. Have already scratched my head a lot on this.
Sure you'd get a better response in the Scout driver repo at https://github.com/teamtnt/laravel-scout-tntsearch-driver