jruby/docs BETA
Navigation
org.apache.lucene.index 131
C AutomatonTermsEnum
C BaseCompositeReader
C BaseTermsEnum
C BinaryDocValues
C ByteVectorValues
C CheckIndex
C CodecReader
C CompositeReader
C CompositeReaderContext
C ConcurrentMergeScheduler
C CorruptIndexException
C DirectoryReader
C DocIDMerger
C DocValues
E DocValuesSkipIndexType
C DocValuesSkipper
E DocValuesType
C DocsWithFieldSet
C EmptyDocValuesProducer
C ExitableDirectoryReader
C FieldInfo
C FieldInfos
C FieldInvertState
C Fields
C FilterBinaryDocValues
C FilterCodecReader
C FilterDirectoryReader
C FilterLeafReader
C FilterMergePolicy
C FilterNumericDocValues
C FilterSortedDocValues
C FilterSortedNumericDocValues
C FilterSortedSetDocValues
C FilteredTermsEnum
C FloatVectorValues
C FreqAndNormBuffer
C Impacts
C ImpactsEnum
I ImpactsSource
C IndexCommit
C IndexDeletionPolicy
C IndexFileNames
C IndexFormatTooNewException
C IndexFormatTooOldException
C IndexNotFoundException
E IndexOptions
C IndexReader
C IndexReaderContext
I IndexSorter
C IndexUpgrader
C IndexWriter
C IndexWriterConfig
I IndexWriterEventListener
I IndexableField
I IndexableFieldType
C KeepLastNCommitsDeletionPolicy
C KeepOnlyLastCommitDeletionPolicy
C KnnVectorValues
C LeafReader
C LeafReaderContext
C LiveIndexWriterConfig
C LogByteSizeMergePolicy
C LogDocMergePolicy
C LogMergePolicy
C MappedMultiFields
C MergePolicy
C MergeRateLimiter
C MergeScheduler
C MergeState
E MergeTrigger
C MultiBits
C MultiDocValues
C MultiFields
C MultiLeafReader
C MultiPostingsEnum
C MultiReader
C MultiTerms
C MultiTermsEnum
C NoDeletionPolicy
C NoMergePolicy
C NoMergeScheduler
C NumericDocValues
C OneMergeWrappingMergePolicy
C OrdTermState
C OrdinalMap
C ParallelCompositeReader
C ParallelLeafReader
C PersistentSnapshotDeletionPolicy
C PointValues
C PostingsEnum
C PrefixCodedTerms
I QueryTimeout
C QueryTimeoutImpl
C ReaderManager
C ReaderUtil
C SegmentCommitInfo
C SegmentInfo
C SegmentInfos
C SegmentOrder
C SegmentReadState
C SegmentReader
C SegmentWriteState
C SerialMergeScheduler
C SimpleMergedSegmentWarmer
C SingleTermsEnum
C SlowCodecReaderWrapper
C SlowImpactsEnum
C SnapshotDeletionPolicy
C SoftDeletesDirectoryReaderWrapper
C SoftDeletesRetentionMergePolicy
C SortFieldProvider
C SortedDocValues
C SortedNumericDocValues
C SortedSetDocValues
C Sorter
C SortingCodecReader
C StandardDirectoryReader
C StoredFieldVisitor
C StoredFields
C Term
C TermState
C TermStates
C TermVectors
C Terms
C TermsEnum
C TieredMergePolicy
I TwoPhaseCommit
C TwoPhaseCommitTool
C UpgradeIndexMergePolicy
E VectorEncoding
E VectorSimilarityFunction
SortedDocValues — members 6+
M intersect(automaton) TermsEnum
M lookup_ord(ord) BytesRef
M lookup_term(key) int
M ord_value() int
M terms_enum() TermsEnum
M value_count() int
from DocIdSetIterator
F NO_MORE_DOCS int
M advance(target) int
M cost() long
M doc_id() int
M doc_id_run_end() int
C into_bit_set(up_to, bit_set, offset)
M next_doc() int
from DocValuesIterator
M advance_exact(target) boolean

org.apache.lucene.index.SortedDocValues

class abstract extends DocValuesIterator 6 members

A per-document byte[] with presorted values. This is fundamentally an iterator over the int ord values per document, with random access APIs to resolve an int ord to BytesRef.

Per-Document values in a SortedDocValues are deduplicated, dereferenced, and sorted into a dictionary of unique values. A pointer to the dictionary value (ordinal) can be retrieved for each document. Ordinals are dense and in increasing sorted order.

Instance Methods

intersect

TermsEnum intersect ( CompiledAutomaton automaton )
Java: intersect(org.apache.lucene.util.automaton.CompiledAutomaton automaton)

Returns a TermsEnum over the values, filtered by a CompiledAutomaton The enum supports TermsEnum#ord().

lookup_ord

BytesRef lookup_ord ( int ord )
Java: lookupOrd(int ord)

Retrieves the value for the specified ordinal. The returned BytesRef may be re-used across calls to #lookupOrd(int) so make sure to copy it if you want to keep it around.

nametypedescription
ordintordinal to lookup (must be >= 0 and < #getValueCount())

lookup_term

int lookup_term ( BytesRef key )
Java: lookupTerm(org.apache.lucene.util.BytesRef key)

If key exists, returns its ordinal, else returns -insertionPoint-1, like Arrays.binarySearch.

nametypedescription
keyorg.apache.lucene.util.BytesRefKey to look up

ord_value

int ord_value ( )
Java: ordValue()

Returns the ordinal for the current docID. It is illegal to call this method after #advanceExact(int) returned false.

Returns: ordinal for the document: this is dense, starts at 0, then increments by 1 for the next value in sorted order.

terms_enum

TermsEnum terms_enum ( )
Java: termsEnum()

Returns a TermsEnum over the values. The enum supports TermsEnum#ord() and TermsEnum#seekExact(long).

value_count

int value_count ( )
Java: getValueCount() · also: get_value_count

Returns the number of unique values.

Returns: number of unique values in this SortedDocValues. This is also equivalent to one plus the maximum ordinal.

Inherited

from DocIdSetIterator

fieldtypenote
NO_MORE_DOCS int When returned by #nextDoc(), #advance(int) and #docID() it means there are no more docs in the iterator.

advance

int advance ( int target )
Java: advance(int target)

Advances to the first beyond the current whose document number is greater than or equal to target, and returns the document number itself. Exhausts the iterator and returns #NO_MORE_DOCS if target is greater than the highest document number in the set.

The behavior of this method is undefined when called with target ≤ current , or after the iterator has exhausted. Both cases may result in unpredicted behavior.

When target > current it behaves as if written:

int advance(int target) {
  int doc;
  while ((doc = nextDoc()) < target) {
  }
  return doc;
}
Some implementations are considerably more efficient than that.

NOTE: this method may be called with #NO_MORE_DOCS for efficiency by some Scorers. If your implementation cannot efficiently determine that it should exhaust, it is recommended that you check for that value in each call to this method.

cost

long cost ( )
Java: cost()

Returns the estimated cost of this DocIdSetIterator.

This is generally an upper bound of the number of documents this iterator might match, but may be a rough heuristic, hardcoded value, or otherwise completely inaccurate.

doc_id

int doc_id ( )
Java: docID()

Returns the following:

  • -1 if #nextDoc() or #advance(int) were not called yet.
  • #NO_MORE_DOCS if the iterator has exhausted.
  • Otherwise it should return the doc ID it is currently on.

doc_id_run_end

int doc_id_run_end ( )
Java: docIDRunEnd()

Returns the end of the run of consecutive doc IDs that match this DocIdSetIterator and that contains the current #docID(), that is: one plus the last doc ID of the run.

  1. The returned doc is greater than #docID().
  2. All docs in range [docID(), docIDRunEnd()) match this iterator.
  3. The current position of this iterator is not affected by calling #docIDRunEnd().

Note: It is illegal to call this method when the iterator is exhausted or not positioned.

The default implementation assumes runs of a single doc ID and returns #docID()) + 1.

into_bit_set

into_bit_set ( int up_to, FixedBitSet bit_set, int offset )
Java: intoBitSet(int upTo, org.apache.lucene.util.FixedBitSet bitSet, int offset)

Load doc IDs into a FixedBitSet. This should behave exactly as if implemented as below, which is the default implementation:

for (int doc = docID(); doc < upTo; doc = nextDoc()) {
  bitSet.set(doc - offset);
}

Note: offset must be less than or equal to the current doc ID. Behaviour is undefined if this iterator is unpositioned.

Note: It is important not to clear bits from bitSet that may be already set.

Note: offset may be negative.

next_doc

int next_doc ( )
Java: nextDoc()

Advances to the next document in the set and returns the doc it is currently on, or #NO_MORE_DOCS if there are no more docs in the set.
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behavior.

from DocValuesIterator

advance_exact

boolean advance_exact ( int target )
Java: advanceExact(int target)

Advance the iterator to exactly target and return whether target has a value. target must be greater than or equal to the current doc ID and must be a valid doc ID, ie. ≥ 0 and < maxDoc. After this method returns, #docID() returns target.

Note: it is illegal to call DocIdSetIterator#intoBitSet or DocIdSetIterator#docIDRunEnd() when this method returns false.

this work for additional information regarding copyright ownership.