I have a Solr instance, and I want to compute my own score for each document, using Solr functionqueries. As an example, say that I have the following query:
q={!func}termfreq('text', 'foo')
When I do this, my result has a numfound that is the number of all documents in the index. I would like to be able to filter out those documents that have a score below a given number, so ideally I would like to filter using a rangequery like this:
fq={!frange l=1}score
since my query parameter determines the result score. But if I do this, I get an error that says:
"error": {
"msg": "undefined field: \"score\"",
"code": 400
}
I have tried instead adding a filter like this:
fq={!frange l=1}termfreq('text', 'foo')
and this gives me the correct results, but my computation is potentially slow, so I would like to know if it is possible to either use the score pseudofield in a filter query, or in some other way make Solr cache the result of the functionquery in the query parameter? Or is there an alternative to the rangequery filter approach, that accomplishes this?
Noticed this has not been answered. Something I myself have looked into. Thought these links might be helpful.
SearchHub
Search-Lucene