While working on LUCENE-5268, I realized we have hasPositions/Offsets/Payloads methods in Terms but not hasFreqs ...
Commit 1531011 from Michael McCandless in branch 'dev/branches/branch_4x'
[ https://svn.apache.org/r1531011 ]
LUCENE-5270: add Terms.hasFreqs
Commit 1531005 from Michael McCandless in branch 'dev/trunk'
[ https://svn.apache.org/r1531005 ]
Looks great, thanks!
New patch folding in Rob's ideas ... I think it's ready.
We also return 1 for freq() when hasFreqs is false. If something else is returned its wrong.
Its only undefined when you explicitly supply FLAG_NONE.
Good idea, I'll add those two checks!
looks great. are there any other checks we can do? like if hasFreqs = false, then sumTotalTermFreq should be -1 (and also totalTermFreq for each term). Otherwise the codec is lying!