Package org.apache.lucene.facet.util
Class ScoredDocIdsUtils
- java.lang.Object
-
- org.apache.lucene.facet.util.ScoredDocIdsUtils
-
public class ScoredDocIdsUtils extends Object
Utility methods for Scored Doc IDs.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description ScoredDocIdsUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScoredDocIDs
createAllDocsScoredDocIDs(org.apache.lucene.index.IndexReader reader)
Creates aScoredDocIDs
which returns document IDs all non-deleted doc ids according to the given reader.static ScoredDocIDs
createScoredDocIds(org.apache.lucene.search.DocIdSet docIdSet, int maxDoc)
Create a ScoredDocIDs out of a given docIdSet and the total number of documents in an indexstatic ScoredDocIDs
createScoredDocIDsSubset(ScoredDocIDs allDocIds, int[] sampleSet)
Create a subset of an existing ScoredDocIDs object.static ScoredDocIDs
getComplementSet(ScoredDocIDs docids, org.apache.lucene.index.IndexReader reader)
Create a complement of the input set.
-
-
-
Method Detail
-
getComplementSet
public static final ScoredDocIDs getComplementSet(ScoredDocIDs docids, org.apache.lucene.index.IndexReader reader) throws IOException
Create a complement of the input set. The returnedScoredDocIDs
does not contain any scores, which makes sense given that the complementing documents were not scored. Note: the complement set does NOT contain doc ids which are noted as deleted by the given reader- Parameters:
docids
- to be complemented.reader
- holding the number of documents & information about deletions.- Throws:
IOException
-
createScoredDocIDsSubset
public static final ScoredDocIDs createScoredDocIDsSubset(ScoredDocIDs allDocIds, int[] sampleSet) throws IOException
Create a subset of an existing ScoredDocIDs object.- Parameters:
allDocIds
- orginal setsampleSet
- Doc Ids of the subset.- Throws:
IOException
-
createAllDocsScoredDocIDs
public static final ScoredDocIDs createAllDocsScoredDocIDs(org.apache.lucene.index.IndexReader reader)
Creates aScoredDocIDs
which returns document IDs all non-deleted doc ids according to the given reader. The returned set contains the range of [0 .. reader.maxDoc ) doc ids
-
createScoredDocIds
public static final ScoredDocIDs createScoredDocIds(org.apache.lucene.search.DocIdSet docIdSet, int maxDoc)
Create a ScoredDocIDs out of a given docIdSet and the total number of documents in an index
-
-