cozydev-pink / protosearch

prototype search library in pure scala
https://cozydev-pink.github.io/protosearch/
Apache License 2.0
9 stars 5 forks source link

Sort results from Scorer #153

Closed valencik closed 5 months ago

valencik commented 9 months ago

The Scorer has a score method:

def score(qs: NonEmptyList[Query], docs: Set[Int]): Either[String, List[(Int, Double)]]

I think the common expectation would be that the list be sorted by Score. This should probably be configurable, but sorting by relevance score would be a good default.

We had to manually sort in the JS in #148 which seems a bit late in the flow.