jruby/docs BETA
Navigation
org.apache.lucene.search.FieldComparator 2
C RelevanceComparator
C TermValComparator
TermValComparator — members 11+
C new(num_hits, field, sort_missing_last)
C bottom=(bottom)
M compare(slot1, slot2) int
M compare_bottom(doc) int
M compare_top(doc) int
M compare_values(val1, val2) int
C copy(slot, doc)
M get_leaf_comparator(context) LeafFieldComparator
C scorer=(scorer)
C top_value=(value)
M value(slot) BytesRef
from LeafFieldComparator
M competitive_iterator() DocIdSetIterator
C set_hits_threshold_reached()
from FieldComparator
C disable_skipping()
C set_single_sort()

org.apache.lucene.search.FieldComparator.TermValComparator

class extends FieldComparator<BytesRef> implements LeafFieldComparator 11 members

Sorts by field's natural Term sort order. All comparisons are done using BytesRef.compareTo, which is slow for medium to large result sets but possibly very fast for very small results sets.

Constructors

new

new ( int num_hits, String field, boolean sort_missing_last )
Java: <init>(int numHits, String field, boolean sortMissingLast)

Sole constructor.

Instance Methods

bottom=

bottom= ( int bottom )
Java: setBottom(int bottom) · also: set_bottom

compare

int compare ( int slot1, int slot2 )
Java: compare(int slot1, int slot2)

compare_bottom

int compare_bottom ( int doc )
Java: compareBottom(int doc)

compare_top

int compare_top ( int doc )
Java: compareTop(int doc)

compare_values

int compare_values ( BytesRef val1, BytesRef val2 )
Java: compareValues(org.apache.lucene.util.BytesRef val1, org.apache.lucene.util.BytesRef val2)

copy

copy ( int slot, int doc )
Java: copy(int slot, int doc)

get_leaf_comparator

LeafFieldComparator get_leaf_comparator ( LeafReaderContext context )
Java: getLeafComparator(org.apache.lucene.index.LeafReaderContext context)

scorer=

scorer= ( Scorable scorer )
Java: setScorer(org.apache.lucene.search.Scorable scorer) · also: set_scorer

top_value=

top_value= ( BytesRef value )
Java: setTopValue(org.apache.lucene.util.BytesRef value) · also: set_top_value

value

BytesRef value ( int slot )
Java: value(int slot)

Inherited

from LeafFieldComparator

competitive_iterator

DocIdSetIterator competitive_iterator ( )
Java: competitiveIterator()

Returns a competitive iterator

Returns: an iterator over competitive docs that are stronger than already collected docs or null if such an iterator is not available for the current comparator or segment.

set_hits_threshold_reached

set_hits_threshold_reached ( )
Java: setHitsThresholdReached()

Informs this leaf comparator that hits threshold is reached. This method is called from a collector when hits threshold is reached.

from FieldComparator

disable_skipping

disable_skipping ( )
Java: disableSkipping()

Informs the comparator that the skipping of documents should be disabled. This function is called by TopFieldCollector in cases when the skipping functionality should not be applied or not necessary. An example could be when search sort is a part of the index sort, and can be already efficiently handled by TopFieldCollector, and doing extra work for skipping in the comparator is redundant.

set_single_sort

set_single_sort ( )
Java: setSingleSort()

Informs the comparator that sort is done on this single field. This is useful to enable some optimizations for skipping non-competitive documents.

this work for additional information regarding copyright ownership.