public int doc() { return docIdSetIterator.doc(); }
/** @deprecated use {@link #docID()} instead. */ public int doc() { return docIdSetIterator.doc(); }
public int doc() { return docIdSetIterator.doc(); }
/** * Perform an inplace OR with the doc ids from a given DocIdSetIterator, * setting the bit for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceOr(DocIdSetIterator disi) throws IOException { while (disi.next() && (disi.doc() < size())) { fastSet(disi.doc()); } }
/** * Perform an inplace NOT with the doc ids from a given DocIdSetIterator, * clearing all the bits for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceNot(DocIdSetIterator disi) throws IOException { while (disi.next() && (disi.doc() < size())) { fastClear(disi.doc()); } }
/** * Perform an inplace XOR with the doc ids from a given DocIdSetIterator, * flipping all the bits for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceXor(DocIdSetIterator disi) throws IOException { while (disi.next() && (disi.doc() < size())) { fastFlip(disi.doc()); } } }
/** * Perform an inplace XOR with the doc ids from a given DocIdSetIterator, * flipping all the bits for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceXor(DocIdSetIterator disi) throws IOException { while (disi.next() && (disi.doc() < size())) { fastFlip(disi.doc()); } } }
/** * Perform an inplace OR with the doc ids from a given DocIdSetIterator, * setting the bit for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceOr(DocIdSetIterator disi) throws IOException { while (disi.next() && (disi.doc() < size())) { fastSet(disi.doc()); } }
/** * Perform an inplace NOT with the doc ids from a given DocIdSetIterator, * clearing all the bits for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceNot(DocIdSetIterator disi) throws IOException { while (disi.next() && (disi.doc() < size())) { fastClear(disi.doc()); } }
/** * Perform an inplace AND with the doc ids from a given DocIdSetIterator, * leaving only the bits set for which the doc ids are in common. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceAnd(DocIdSetIterator disi) throws IOException { int index = nextSetBit(0); int lastNotCleared = -1; while ((index != -1) && disi.skipTo(index)) { while ((index != -1) && (index < disi.doc())) { fastClear(index); index = nextSetBit(index + 1); } if (index == disi.doc()) { lastNotCleared = index; index++; } assert (index == -1) || (index > disi.doc()); } clear(lastNotCleared+1, size()); }
/** * Perform an inplace AND with the doc ids from a given DocIdSetIterator, * leaving only the bits set for which the doc ids are in common. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void inPlaceAnd(DocIdSetIterator disi) throws IOException { int index = nextSetBit(0); int lastNotCleared = -1; while ((index != -1) && disi.skipTo(index)) { while ((index != -1) && (index < disi.doc())) { fastClear(index); index = nextSetBit(index + 1); } if (index == disi.doc()) { lastNotCleared = index; index++; } assert (index == -1) || (index > disi.doc()); } clear(lastNotCleared+1, size()); }
/** * Create a SortedVIntList. * @param docIdSetIterator An iterator providing document numbers as a set of integers. * This DocIdSetIterator is iterated completely when this constructor * is called and it must provide the integers in non * decreasing order. */ public SortedVIntList(DocIdSetIterator docIdSetIterator) throws IOException { SortedVIntListBuilder builder = new SortedVIntListBuilder(); while (docIdSetIterator.next()) { builder.addInt(docIdSetIterator.doc()); } builder.done(); }
/** * Create a SortedVIntList. * @param docIdSetIterator An iterator providing document numbers as a set of integers. * This DocIdSetIterator is iterated completely when this constructor * is called and it must provide the integers in non * decreasing order. */ public SortedVIntList(DocIdSetIterator docIdSetIterator) throws IOException { SortedVIntListBuilder builder = new SortedVIntListBuilder(); while (docIdSetIterator.next()) { builder.addInt(docIdSetIterator.doc()); } builder.done(); }
public void search(Weight weight, Filter filter, final HitCollector results) throws IOException { Scorer scorer = weight.scorer(reader); if (scorer == null) return; if (filter == null) { scorer.score(results); return; } DocIdSetIterator filterDocIdIterator = filter.getDocIdSet(reader).iterator(); // CHECKME: use ConjunctionScorer here? boolean more = filterDocIdIterator.next() && scorer.skipTo(filterDocIdIterator.doc()); while (more) { int filterDocId = filterDocIdIterator.doc(); if (filterDocId > scorer.doc() && !scorer.skipTo(filterDocId)) { more = false; } else { int scorerDocId = scorer.doc(); if (scorerDocId == filterDocId) { // permitted by filter results.collect(scorerDocId, scorer.score()); more = filterDocIdIterator.next(); } else { more = filterDocIdIterator.skipTo(scorerDocId); } } } }
public void search(Weight weight, Filter filter, final HitCollector results) throws IOException { Scorer scorer = weight.scorer(reader); if (scorer == null) return; if (filter == null) { scorer.score(results); return; } DocIdSetIterator filterDocIdIterator = filter.getDocIdSet(reader).iterator(); // CHECKME: use ConjunctionScorer here? boolean more = filterDocIdIterator.next() && scorer.skipTo(filterDocIdIterator.doc()); while (more) { int filterDocId = filterDocIdIterator.doc(); if (filterDocId > scorer.doc() && !scorer.skipTo(filterDocId)) { more = false; } else { int scorerDocId = scorer.doc(); if (scorerDocId == filterDocId) { // permitted by filter results.collect(scorerDocId, scorer.score()); more = filterDocIdIterator.next(); } else { more = filterDocIdIterator.skipTo(scorerDocId); } } } }
public Explanation explain (IndexReader ir, int i) throws IOException { Explanation inner = weight.explain (ir, i); if (getBoost()!=1) { Explanation preBoost = inner; inner = new Explanation(inner.getValue()*getBoost(),"product of:"); inner.addDetail(new Explanation(getBoost(),"boost")); inner.addDetail(preBoost); } Filter f = FilteredQuery.this.filter; DocIdSetIterator docIdSetIterator = f.getDocIdSet(ir).iterator(); if (docIdSetIterator.skipTo(i) && (docIdSetIterator.doc() == i)) { return inner; } else { Explanation result = new Explanation (0.0f, "failure to match filter: " + f.toString()); result.addDetail(inner); return result; } }
public Explanation explain (IndexReader ir, int i) throws IOException { Explanation inner = weight.explain (ir, i); if (getBoost()!=1) { Explanation preBoost = inner; inner = new Explanation(inner.getValue()*getBoost(),"product of:"); inner.addDetail(new Explanation(getBoost(),"boost")); inner.addDetail(preBoost); } Filter f = FilteredQuery.this.filter; DocIdSetIterator docIdSetIterator = f.getDocIdSet(ir).iterator(); if (docIdSetIterator.skipTo(i) && (docIdSetIterator.doc() == i)) { return inner; } else { Explanation result = new Explanation (0.0f, "failure to match filter: " + f.toString()); result.addDetail(inner); return result; } }
public Explanation explain(IndexReader reader, int doc) throws IOException { ConstantScorer cs = (ConstantScorer)scorer(reader); boolean exists = cs.docIdSetIterator.skipTo(doc) && (cs.docIdSetIterator.doc() == doc); ComplexExplanation result = new ComplexExplanation(); if (exists) { result.setDescription("ConstantScoreQuery(" + filter + "), product of:"); result.setValue(queryWeight); result.setMatch(Boolean.TRUE); result.addDetail(new Explanation(getBoost(), "boost")); result.addDetail(new Explanation(queryNorm,"queryNorm")); } else { result.setDescription("ConstantScoreQuery(" + filter + ") doesn't match id " + doc); result.setValue(0); result.setMatch(Boolean.FALSE); } return result; } }
public Explanation explain(IndexReader reader, int doc) throws IOException { ConstantScorer cs = (ConstantScorer)scorer(reader); boolean exists = cs.docIdSetIterator.skipTo(doc) && (cs.docIdSetIterator.doc() == doc); ComplexExplanation result = new ComplexExplanation(); if (exists) { result.setDescription("ConstantScoreQuery(" + filter + "), product of:"); result.setValue(queryWeight); result.setMatch(Boolean.TRUE); result.addDetail(new Explanation(getBoost(), "boost")); result.addDetail(new Explanation(queryNorm,"queryNorm")); } else { result.setDescription("ConstantScoreQuery(" + filter + ") doesn't match id " + doc); result.setValue(0); result.setMatch(Boolean.FALSE); } return result; } }