Closed oasiz closed 1 year ago
Hi @oasiz ,
the results are always returned by MiniSearch
in order of descending score (highest score first), so you do not need to re-sort them.
It is possible that something in your code causes the order to change? If you can share some code I might be able to help identify the problem.
Hi @oasiz , I am going to close this, as it does not seem to be an issue with the library (see this JSbin demonstrating that results are returned highest score first).
If you can provide some code, comment on this thread, and I am happy to help you debug your specific issue.
Hi Luca. Apologies for not replying sooner, it’s been a hectic few days!
Yes you are absolutely right, it was code I had introduced (callback function) that had somehow messed up the order. Whoops!
Thanks for getting back to me, I hope you have a fantastic Christmas and New Year 😃
Good to hear you solved it :) Have a great time too!!
Hi, hope you are well!
Is there a way of sorting the results by highest score (first)?
I tried adding this but it doesn't seem to work:
.sort(function(a, b){return b.score - a.score})
Appreciate your help :-)