Package org.apache.solr.search
Class DocSetUtil
- java.lang.Object
-
- org.apache.solr.search.DocSetUtil
-
public class DocSetUtil extends Object
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description DocSetUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
collectSortedDocSet(DocSet docs, org.apache.lucene.index.IndexReader reader, org.apache.lucene.search.Collector collector)
static DocSet
createDocSet(SolrIndexSearcher searcher, org.apache.lucene.index.Term term)
static DocSet
createDocSet(SolrIndexSearcher searcher, org.apache.lucene.search.Query query, DocSet filter)
static DocSet
createDocSetGeneric(SolrIndexSearcher searcher, org.apache.lucene.search.Query query)
static boolean
equals(DocSet a, DocSet b)
Iterates DocSets to test for equality - slow and for testing purposes only.static DocSet
getDocSet(DocSetCollector collector, SolrIndexSearcher searcher)
This variant of getDocSet will attempt to do some deduplication on certain DocSets such as DocSets that match numDocs.static DocSet
getDocSet(DocSet docs, SolrIndexSearcher searcher)
This variant of getDocSet maps all sets with size numDocs to searcher.getLiveDocs.static int
smallSetSize(int maxDoc)
The cut-off point for small sets (SortedIntDocSet) vs large sets (BitDocSet)static DocSet
toSmallSet(BitDocSet bitSet)
-
-
-
Method Detail
-
smallSetSize
public static int smallSetSize(int maxDoc)
The cut-off point for small sets (SortedIntDocSet) vs large sets (BitDocSet)For ridiculously small sets, we'll just use a sorted int[].
maxDoc >>> 6
is a good value if you want to save memory, lower values such asmaxDoc >>> 11
should provide faster building but at the expense of using a full bitset even for quite sparse data.
-
equals
public static boolean equals(DocSet a, DocSet b)
Iterates DocSets to test for equality - slow and for testing purposes only.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
getDocSet
public static DocSet getDocSet(DocSetCollector collector, SolrIndexSearcher searcher)
This variant of getDocSet will attempt to do some deduplication on certain DocSets such as DocSets that match numDocs. This means it can return a cached version of the set, and the returned set should not be modified.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
getDocSet
public static DocSet getDocSet(DocSet docs, SolrIndexSearcher searcher)
This variant of getDocSet maps all sets with size numDocs to searcher.getLiveDocs. The returned set should not be modified.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
createDocSet
public static DocSet createDocSet(SolrIndexSearcher searcher, org.apache.lucene.search.Query query, DocSet filter) throws IOException
- Throws:
IOException
-
createDocSetGeneric
public static DocSet createDocSetGeneric(SolrIndexSearcher searcher, org.apache.lucene.search.Query query) throws IOException
- Throws:
IOException
-
createDocSet
public static DocSet createDocSet(SolrIndexSearcher searcher, org.apache.lucene.index.Term term) throws IOException
- Throws:
IOException
-
collectSortedDocSet
public static void collectSortedDocSet(DocSet docs, org.apache.lucene.index.IndexReader reader, org.apache.lucene.search.Collector collector) throws IOException
- Throws:
IOException
-
-