public int read(final int[] docs, final int[] freqs) throws IOException { if (termDocs==null) return 0; return termDocs.read(docs, freqs); }
public int read(final int[] docs, final int[] freqs) throws IOException { if (termDocs==null) return 0; return termDocs.read(docs, freqs); }
public int read(int[] docs, int[] freqs) throws IOException { return in.read(docs, freqs); } public boolean skipTo(int i) throws IOException { return in.skipTo(i); }
public int read(int[] docs, int[] freqs) throws IOException { return in.read(docs, freqs); } public boolean skipTo(int i) throws IOException { return in.skipTo(i); }
public int read(int[] docs, int[] freqs) throws IOException { return in.read(docs, freqs); } public boolean skipTo(int i) throws IOException { return in.skipTo(i); }
/** * @inheritDoc */ public final int read(int[] docs, int[] freqs) throws IOException { for (;;) { int num = in.read(docs, freqs); if (num == 0) { // no more docs return 0; } // need to check for deleted docs int numDeleted = 0; for (int i = 0; i < num; i++) { if (deleted.get(docs[i])) { numDeleted++; continue; } // check if we need to shift if (numDeleted > 0) { docs[i - numDeleted] = docs[i]; freqs[i - numDeleted] = freqs[i]; } } if (num != numDeleted) { return num - numDeleted; } } }
public boolean next() throws IOException { pointer++; if (pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffer if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; return true; }
/** Advances to the next document matching the query. * <br>The iterator over the matching documents is buffered using * {@link TermDocs#read(int[],int[])}. * @return true iff there is another document matching the query. */ public boolean next() throws IOException { pointer++; if (pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffer if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; return true; }
/** Advances to the next document matching the query. * <br>The iterator over the matching documents is buffered using * {@link TermDocs#read(int[],int[])}. * @return true iff there is another document matching the query. */ public boolean next() throws IOException { pointer++; if (pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffer if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; return true; }
/** Advances to the next document matching the query. * <br>The iterator over the matching documents is buffered using * {@link TermDocs#read(int[],int[])}. * @return true iff there is another document matching the query. */ public boolean next() throws IOException { pointer++; if (pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffer if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; return true; }
/** Advances to the next document matching the query. * <br>The iterator over the matching documents is buffered using * {@link TermDocs#read(int[],int[])}. * @return true iff there is another document matching the query. */ public boolean next() throws IOException { pointer++; if (pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffer if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; return true; }
/** Optimized implementation. */ public int read(final int[] docs, final int[] freqs) throws IOException { while (true) { while (current == null) { if (pointer < readers.length) { // try next segment base = starts[pointer]; current = termDocs(pointer++); } else { return 0; } } int end = current.read(docs, freqs); if (end == 0) { // none left in segment current = null; } else { // got some final int b = base; // adjust doc numbers for (int i = 0; i < end; i++) docs[i] += b; return end; } } }
/** Optimized implementation. */ public int read(final int[] docs, final int[] freqs) throws IOException { while (true) { while (current == null) { if (pointer < readers.length) { // try next segment base = starts[pointer]; current = termDocs(pointer++); } else { return 0; } } int end = current.read(docs, freqs); if (end == 0) { // none left in segment current = null; } else { // got some final int b = base; // adjust doc numbers for (int i = 0; i < end; i++) docs[i] += b; return end; } } }
/** Optimized implementation. */ public int read(final int[] docs, final int[] freqs) throws IOException { while (true) { while (current == null) { if (pointer < readers.length) { // try next segment base = starts[pointer]; current = termDocs(pointer++); } else { return 0; } } int end = current.read(docs, freqs); if (end == 0) { // none left in segment current = null; } else { // got some final int b = base; // adjust doc numbers for (int i = 0; i < end; i++) docs[i] += b; return end; } } }
protected boolean score(HitCollector c, int end) throws IOException { Similarity similarity = getSimilarity(); // cache sim in local float[] normDecoder = Similarity.getNormDecoder(); while (doc < end) { // for docs in window int f = freqs[pointer]; float score = // compute tf(f)*weight f < SCORE_CACHE_SIZE // check cache ? scoreCache[f] // cache hit : similarity.tf(f)*weightValue; // cache miss score *= normDecoder[norms[doc] & 0xFF]; // normalize for field c.collect(doc, score); // collect score if (++pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffers if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; } return true; }
protected boolean score(HitCollector c, int end) throws IOException { Similarity similarity = getSimilarity(); // cache sim in local float[] normDecoder = Similarity.getNormDecoder(); while (doc < end) { // for docs in window int f = freqs[pointer]; float score = // compute tf(f)*weight f < SCORE_CACHE_SIZE // check cache ? scoreCache[f] // cache hit : similarity.tf(f)*weightValue; // cache miss score *= normDecoder[(norms == null ? DEFAULT_NORM : norms[doc]) & 0xFF]; // normalize for field c.collect(doc, score); // collect score if (++pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffers if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; } return true; }
protected boolean score(HitCollector c, int end) throws IOException { Similarity similarity = getSimilarity(); // cache sim in local float[] normDecoder = Similarity.getNormDecoder(); while (doc < end) { // for docs in window int f = freqs[pointer]; float score = // compute tf(f)*weight f < SCORE_CACHE_SIZE // check cache ? scoreCache[f] // cache hit : similarity.tf(f)*weightValue; // cache miss score *= normDecoder[(norms == null ? DEFAULT_NORM : norms[doc]) & 0xFF]; // normalize for field c.collect(doc, score); // collect score if (++pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffers if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; } return true; }
protected boolean score(HitCollector c, int end) throws IOException { Similarity similarity = getSimilarity(); // cache sim in local float[] normDecoder = Similarity.getNormDecoder(); while (doc < end) { // for docs in window int f = freqs[pointer]; float score = // compute tf(f)*weight f < SCORE_CACHE_SIZE // check cache ? scoreCache[f] // cache hit : similarity.tf(f)*weightValue; // cache miss score *= normDecoder[norms[doc] & 0xFF]; // normalize for field c.collect(doc, score); // collect score if (++pointer >= pointerMax) { pointerMax = termDocs.read(docs, freqs); // refill buffers if (pointerMax != 0) { pointer = 0; } else { termDocs.close(); // close stream doc = Integer.MAX_VALUE; // set to sentinel value return false; } } doc = docs[pointer]; } return true; }
return in.read(docs,freqs);