Open mschoch opened 8 years ago
I'm moving this to 1.x. We've come a long way without this, I don't think it should hold up a 1 .0 release.
I'm going to initially target it for 1.x as I think it could be done without any breaking changes to the API (by introducing a custom score Query which wraps other queries). But, if we find it requires API changes it could move to 2.0 later.
I wanted to accomplish this, and searching through issues doesn't seem to turn up anything useful, so I decided to add this note showcasing my workaround for this issue. The basic process is to:
query.Query
implementation that accepts a subquery.Searcher
method for this query should call the subquery's Searcher
and wrap it with FilteringSearcher
, providing a custom filter.An implementation providing a "freshness" score can be seen in this gist.
Downsides to this workaround: you have to get into the internals of the index to read the values; my reference implementation does not appear in query explanations (adding support for this would not be hard).
Hi @CGamesPlay , I took your Gist and went a bit further generalizing it into a BoostingQuery
, in this Gist. Hopefully this helps some folks who have similarly complex boost requirements (in my case, I needed to boost if a facet is a certain value).
Are there negative performance impacts from this sort of booster/weighter? Obviously it's faster if it doesn't have to run, but is there anything I should be looking out for?
provide your own go function, be able to use other indexed/stored values
@mattetti