In SOLR, you can use the function query directly to query the docFreq shown here: http://wiki.apache.org/solr/FunctionQuery#docfreq ,
q={!func}docFreq(tweet_text, kw)
Note. Also on this page are documented methods for requesting functions to get tf, idf and termfreq, which may also be useful to you.
This is probably less relevant for this issue , retrospectively, but I will leave it for a while if it is useful to you.
IndexReader.docFreq (Term) can provide you with what you are looking for.
eg:
reader.docFreq(new Term("tweet_text", kw));'
IndexSearcher.docFreq (Term) is the same, by the way.
source share