This will break performance. It is better to first collect all the document
numbers (code without the proper declarations):
public void collect(int id, float score) {
if(docCount >= startDoc && docCount < endDoc) {
docNrs.add(id); // or use int[] docNrs when possible.
....
Why
public void collect(int id, float score) {
if(docCount >= startDoc && docCount < endDoc) {
is requiered.
i think the bertter thing is
public void collect(int id, float score) {
docNrs.add(id); // or use int[] docNrs when possible.
because anyhow the collect metod will be called total number of matched
documents times.
why should we introfuce one more condition....