Closed myalgo closed 7 years ago
The score returned probably isn't useful for anything other than sorting. I.e. you won't be able to use it to say a document is 83% relevant to a query.
Lunr treats documents and queries as many dimensional vectors, and then uses a technique based on cosine similarity to calculate how similar the vectors are. From the linked article you would imagine the scores would range from 0 to 1. However, due to field boosts and other implementation details of the way Lunr scores this is not true of the returned score.
The closest you might be able to get is to bucket the results into something like "high", "medium" or "low" relative to each other, though I'm not sure how useful that would be.
I would like to show relevance of search results. However not sure the range of score returned. I have seen score ranges from approx 0.001x to 3.x.