@Override protected void firstPosting(Posting _p) { super.firstPosting(_p); FieldPosting p = (FieldPosting)_p; System.arraycopy(p.getFieldFrequencies(), 0, fieldFreqs, 0, fieldCount); System.arraycopy(p.getFieldLengths(), 0, fieldLens, 0, fieldCount); }
@Override protected void firstPosting(Posting _p) { super.firstPosting(_p); FieldPosting p = (FieldPosting)_p; System.arraycopy(p.getFieldFrequencies(), 0, fieldFreqs, 0, fieldCount); System.arraycopy(p.getFieldLengths(), 0, fieldLens, 0, fieldCount); }
/** {@inheritDoc} */ @Override public int next() throws IOException { IterablePosting ip = postingQueue.poll(); if (ip == null) return id = IterablePosting.EOL; id = ip.getId(); firstPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); while(postingQueue.size() > 0 && postingQueue.peek().getId() == id) { ip = postingQueue.poll(); addPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); } return id; }
/** {@inheritDoc} */ @Override public int next() throws IOException { IterablePosting ip = postingQueue.poll(); if (ip == null) return id = IterablePosting.EOL; id = ip.getId(); firstPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); while(postingQueue.size() > 0 && postingQueue.peek().getId() == id) { ip = postingQueue.poll(); addPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); } return id; }
@Override public int next(int target) throws IOException { final IterablePosting ips[] = postingQueue.toArray(new IterablePosting[postingQueue.size()]); postingQueue.clear(); boolean OK = false; for(IterablePosting ip : ips) { if (ip.getId() >= target || (ip.next(target) != IterablePosting.EOL)) { postingQueue.add(ip); OK = true; } } if (! OK) return id = IterablePosting.EOL; IterablePosting ip = postingQueue.poll(); id = ip.getId(); firstPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); while(postingQueue.size() > 0 && postingQueue.peek().getId() == id) { ip = postingQueue.poll(); addPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); } return id; }
@Override public int next(int target) throws IOException { final IterablePosting ips[] = postingQueue.toArray(new IterablePosting[postingQueue.size()]); postingQueue.clear(); boolean OK = false; for(IterablePosting ip : ips) { if (ip.getId() >= target || (ip.next(target) != IterablePosting.EOL)) { postingQueue.add(ip); OK = true; } } if (! OK) return id = IterablePosting.EOL; IterablePosting ip = postingQueue.poll(); id = ip.getId(); firstPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); while(postingQueue.size() > 0 && postingQueue.peek().getId() == id) { ip = postingQueue.poll(); addPosting(ip); if (ip.next() != IterablePosting.EOL) postingQueue.add(ip); } return id; }
@Override protected void firstPosting(Posting p) { super.firstPosting(p); if (positions.size() > 30) { positions.clear(); positions.compact(); } else { positions.clear(); } positions.addAll(((BlockPosting)p).getPositions()); }
@Override protected void firstPosting(Posting p) { super.firstPosting(p); if (positions.size() > 30) { positions.clear(); positions.compact(); } else { positions.clear(); } positions.addAll(((BlockPosting)p).getPositions()); }