Prasanna R 2010-05-25, 20:59
Chris Hostetter 2010-06-01, 18:57
-Re: Enhancing Solr relevance functions through predefined constants
Prasanna R 2010-06-01, 20:06
On Tue, Jun 1, 2010 at 11:57 AM, Chris Hostetter
> : I have a suggestion for improving relevance functions in Solr by way of
> : providing access to a set of pre-defined constants in Solr queries.
> : Specifically, the number of documents indexed, the number of unique terms
> : a field, the total number of terms in a field, etc. are some of the
> : query-time constants that I believe can be made use of in function
> : as well as boosted queries to aid in the relevance calculations.
> I'm not sure if he was inspired by your email or not, but i did notice
> yonik just opened an issue that sounds very similar to this...
This bug definitely addresses what I had in mind. Glad to see a patch out
for it. I feel this has the potential to become pretty big once we have some
real use cases for it.
> FWIW: number of unique terms in a field is reall, really, expensive to
> compute (although perhaps we could cache it somewhere)
The number of unique terms (and other similar metrics) is pretty much a
query-time constant and we can have it optionally computed and then cached
at the end of every major index build which will make it readily available
for consumption. This will be particularly suited for cases where we have
indexes being built on a node(s) that does not serve traffic and then is
replicated to the servers that handle the traffic.