> We have documents which are comprised > of: > > - A short list of terms (about 1 to 5 terms > per document) > - An estimate of the probability of the terms > occurrence (stored as tint) > > For each term in the index, we would like to get the result > of the following function: > > (our estimate of the probability/100) x (a > term's Document Frequency) > > So if the term "fox" occurred in 7 documents, the desired > query result would look something like: > > <doc> > <str name="term">fox</str> > <str name="DF">7</str> > <int name="probability">23</int> > <str name="functionResult">1.61</str> > </doc> > > We can find a number of examples for using function queries > to alter scoring or sorting results, but can not find any > that show how to get the value of actual function result > back.
It seems that your requirement is not related to function queries. You are interested something that is term level rather than document level. Anyway with http://wiki.apache.org/solr/TermsComponent you can iterate through all terms and it gives you DF information. You can multiple that DF with pre-computed (term level) probability. To get all terms use -1 as limit. e.g. = &terms.limit=-1