OK -- I did find SOLR-1298
<https://issues.apache.org/jira/browse/SOLR-1298>which explains how to
request the function as a field value. Still looking for a function
that does what I asked for ...
<https://issues.apache.org/jira/browse/SOLR-1298>
On 11/18/2013 11:55 AM, Michael Sokolov wrote:
Some of our customers want to display a "number of matches" score next
to each search result. I think what they want is to list the number
of matches that will be displayed when the entire document is
highlighted. But this can be slow to do for every search result (some
documents can be very large), so what we'd like to do is to count the
number of terms that match the query for each document, and display that.
It looks like Solr's function query has some support for this - I see
the termfreq function, for example. My question is:
1. Is it possible to execute the query as usual, retrieving document
stored field values, and also to run a function, and return the result
as the value of a computed "pseudo-field"?
2. Is there an existing function known to the function query parser
that counts the total number of occurrences of all terms in the query
(for the current hit document)?
-Mike