tntsearch icon indicating copy to clipboard operation
tntsearch copied to clipboard

Searching multiple models in Laravel and ranking them

Open TheBigK opened this issue 6 years ago • 1 comments

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.

TheBigK avatar Mar 09 '18 03:03 TheBigK

Sure you'd get a better response in the Scout driver repo at https://github.com/teamtnt/laravel-scout-tntsearch-driver

ultrono avatar Mar 09 '18 19:03 ultrono