Package org.apache.lucene.index
Class SingletonSortedSetDocValues
java.lang.Object
org.apache.lucene.index.SortedSetDocValues
org.apache.lucene.index.SingletonSortedSetDocValues
Exposes multi-valued view over a single-valued instance.
 
This can be used if you want to have one multi-valued implementation against e.g. FieldCache.getDocTermOrds that also works for single-valued fields.
- 
Field SummaryFields inherited from class org.apache.lucene.index.SortedSetDocValuesEMPTY, NO_MORE_ORDS
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a multi-valued view over the provided SortedDocValues
- 
Method SummaryModifier and TypeMethodDescriptionReturn the wrappedSortedDocValueslongReturns the number of unique values.voidRetrieves the value for the specified ordinal.longlookupTerm(BytesRef key) Ifkeyexists, returns its ordinal, else returns-insertionPoint-1, likeArrays.binarySearch.longnextOrd()Returns the next ordinal for the current document (previously set bySortedSetDocValues.setDocument(int).voidsetDocument(int docID) Sets iteration to the specified docIDMethods inherited from class org.apache.lucene.index.SortedSetDocValuestermsEnum
- 
Constructor Details- 
SingletonSortedSetDocValuesCreates a multi-valued view over the provided SortedDocValues
 
- 
- 
Method Details- 
getSortedDocValuesReturn the wrappedSortedDocValues
- 
nextOrdpublic long nextOrd()Description copied from class:SortedSetDocValuesReturns the next ordinal for the current document (previously set bySortedSetDocValues.setDocument(int).- Specified by:
- nextOrdin class- SortedSetDocValues
- Returns:
- next ordinal for the document, or SortedSetDocValues.NO_MORE_ORDS. ordinals are dense, start at 0, then increment by 1 for the next value in sorted order.
 
- 
setDocumentpublic void setDocument(int docID) Description copied from class:SortedSetDocValuesSets iteration to the specified docID- Specified by:
- setDocumentin class- SortedSetDocValues
- Parameters:
- docID- document ID
 
- 
lookupOrdDescription copied from class:SortedSetDocValuesRetrieves the value for the specified ordinal.- Specified by:
- lookupOrdin class- SortedSetDocValues
- Parameters:
- ord- ordinal to lookup
- result- will be populated with the ordinal's value
- See Also:
 
- 
getValueCountpublic long getValueCount()Description copied from class:SortedSetDocValuesReturns the number of unique values.- Specified by:
- getValueCountin class- SortedSetDocValues
- Returns:
- number of unique values in this SortedDocValues. This is also equivalent to one plus the maximum ordinal.
 
- 
lookupTermDescription copied from class:SortedSetDocValuesIfkeyexists, returns its ordinal, else returns-insertionPoint-1, likeArrays.binarySearch.- Overrides:
- lookupTermin class- SortedSetDocValues
- Parameters:
- key- Key to look up
 
 
-