public DocSet intersection(DocSet other) { return docSet.intersection(other); }
DocSet res=searcher.getDocSet(query); test( res.size() >= results.size() ); test( res.intersection(filter).equals(both.docSet));
@Override public DocSet intersection(DocSet other) { if (other instanceof SortedIntDocSet || other instanceof HashDocSet) { return other.intersection(this); } HashDocSet h = new HashDocSet(docs,offset,len); return h.intersection(other); }
if (!neg[i] && i!=smallestIndex) answer = answer.intersection(sets[i]);
public DocSet intersection(DocSet other) { // intersection is overloaded in the smaller DocSets to be more // efficient, so dispatch off of it instead. if (!(other instanceof BitDocSet)) { return other.intersection(this); } // Default... handle with bitsets. OpenBitSet newbits = (OpenBitSet)(this.getBits().clone()); newbits.and(other.getBits()); return new BitDocSet(newbits); }
/** * Returns the set of document ids matching both the query and the filter. * This method is cache-aware and attempts to retrieve the answer from the cache if possible. * If the answer was not cached, it may have been inserted into the cache as a result of this call. * <p> * * @param query * @param filter may be null * @return DocSet meeting the specified criteria, should <b>not</b> be modified by the caller. */ public DocSet getDocSet(Query query, DocSet filter, DocSetAwareCollector collector) throws IOException { if (filter==null) return getDocSet(query, collector); // Negative query if absolute value different from original Query absQ = QueryUtils.getAbs(query); boolean positive = absQ==query; DocSet first; if (filterCache != null) { first = (DocSet)filterCache.get(absQ); if (first==null) { first = getDocSetNC(absQ,null); filterCache.put(absQ,first); } return positive ? first.intersection(filter) : filter.andNot(first); } // If there isn't a cache, then do a single filtered query if positive. return positive ? getDocSetNC(absQ,filter,collector) : filter.andNot(getPositiveDocSet(absQ, collector)); }
DocSet bigTermDocSet = searcher.getDocSet(new TermQuery(tt.term)).intersection(docs); DocIterator iter = bigTermDocSet.iterator(); while (iter.hasNext()) {
out.docSet = getDocSet(cmd.getQuery(),cmd.getFilter()); DocSet bigFilt = getDocSet(cmd.getFilterList()); if (bigFilt != null) out.docSet = out.docSet.intersection(bigFilt);