well-typed / full-text-search

An in-memory full text search engine library. It lets you run full-text queries on a collection of your documents.
Other
47 stars 5 forks source link

Injecting/prioritising search results #10

Open adamgundry opened 2 years ago

adamgundry commented 2 years ago

Sometimes client code would like to insert additional results, typically in front of the full-text-search results. For example https://github.com/haskell/hackage-server/commit/cf0f17ed0a86e52c689f9adbe2fd07940597e3cb added a feature to hackage-server to prioritize exact package name matches. I've also got an application that does this by looking up query terms in a separate map. Of course the remaining results then need to be filtered to leave out those that have been prioritized.

It isn't clear if this needs to be in full-text-search itself or if it can just be implemented by the client. The implementation in hackage-server adds a new function lookupDocKeyReal, so we might need an equivalent of that at least.