jruby/docs BETA
Navigation
org.apache.lucene.search 162
C AbstractDocIdSetIterator
C AbstractKnnCollector
C AcceptDocs
C AutomatonQuery
C BlendedTermQuery
C BooleanQuery
I BoostAttribute
C BoostAttributeImpl
C BoostQuery
C BulkScorer
C ByteVectorSimilarityQuery
C CachingCollector
I CheckedIntConsumer
C CollectionTerminatedException
I Collector
I CollectorManager
C CombinedFieldQuery
C ConjunctionUtils
C ConstantScoreQuery
C ConstantScoreScorer
C ConstantScoreScorerSupplier
C ConstantScoreWeight
C ControlledRealTimeReopenThread
C DisiPriorityQueue
C DisiWrapper
C DisjunctionDISIApproximation
C DisjunctionMaxQuery
C DocAndFloatFeatureBuffer
C DocAndScoreAccBuffer
C DocIdSet
C DocIdSetBulkIterator
C DocIdSetIterator
C DocIdStream
C DocValuesRangeIterator
C DocValuesRewriteMethod
C DoubleValues
C DoubleValuesSource
C DoubleValuesSourceRescorer
C ExactPhraseMatcher
C Explanation
C FieldComparator
C FieldComparatorSource
C FieldDoc
C FieldExistsQuery
C FieldValueHitQueue
C FilterCollector
C FilterDocIdSetIterator
C FilterLeafCollector
C FilterMatchesIterator
C FilterScorable
C FilterScorer
C FilterWeight
C FilteredDocIdSetIterator
C FloatVectorSimilarityQuery
C FullPrecisionFloatVectorSimilarityValuesSource
C FuzzyQuery
C FuzzyTermsEnum
C HitQueue
C HnswQueueSaturationCollector
C ImpactsDISI
C IndexOrDocValuesQuery
C IndexSearcher
C IndexSortSortedNumericDocValuesRangeQuery
C IndriAndQuery
C IndriAndScorer
C IndriAndWeight
C IndriDisjunctionScorer
C IndriQuery
C IndriScorer
C KnnByteVectorQuery
I KnnCollector
C KnnFloatVectorQuery
C LRUQueryCache
C LateInteractionFloatValuesSource
C LateInteractionRescorer
I LeafCollector
I LeafFieldComparator
C LiveFieldValues
C LongValues
C LongValuesSource
C MatchAllDocsQuery
C MatchNoDocsQuery
I Matches
I MatchesIterator
C MatchesUtils
I MaxNonCompetitiveBoostAttribute
C MaxNonCompetitiveBoostAttributeImpl
C MaxScoreCache
C MultiCollector
C MultiCollectorManager
C MultiPhraseQuery
C MultiTermQuery
I MultiVectorSimilarity
C Multiset
C NGramPhraseQuery
C NamedMatches
C NumericDocValuesRangeQuery
C PatienceKnnVectorQuery
C PhraseMatcher
C PhraseQuery
C PhraseWeight
C PointInSetQuery
C PointRangeQuery
C PositiveScoresOnlyCollector
C PrefixQuery
E Pruning
C Query
I QueryCache
I QueryCachingPolicy
C QueryRescorer
C QueryVisitor
C ReferenceManager
I RefreshCommitSupplier
C RegexpQuery
C RescoreTopNQuery
C Rescorer
C Scorable
C ScoreCachingWrappingScorer
C ScoreDoc
E ScoreMode
C Scorer
C ScorerSupplier
C ScoringRewrite
C SearcherFactory
C SearcherLifetimeManager
C SearcherManager
C SeededKnnVectorQuery
I SegmentCacheable
C SimpleCollector
C SimpleFieldComparator
C SkipBlockRangeIterator
C SloppyPhraseMatcher
C Sort
C SortField
C SortRescorer
C SortedNumericSelector
C SortedNumericSortField
C SortedSetSelector
C SortedSetSortField
C SynonymQuery
C TaskExecutor
C TermInSetQuery
C TermQuery
C TermRangeQuery
C TermScorer
C TimeLimitingKnnCollectorManager
C TopDocs
C TopDocsCollector
C TopFieldCollector
C TopFieldCollectorManager
C TopFieldDocs
C TopKnnCollector
C TopScoreDocCollector
C TopScoreDocCollectorManager
C TopTermsRewrite
C TotalHitCountCollector
C TotalHitCountCollectorManager
C TwoPhaseIterator
C UsageTrackingQueryCachingPolicy
I VectorScorer
C Weight
C WildcardQuery
SortedSetSortField — members 10+
C new(field, reverse)
C new(field, reverse, selector)
C new(field, reverse, selector, missing_value)
M equals(obj) boolean
M get_comparator(num_hits, pruning) FieldComparator<?>
M hash_code() int
M index_sorter() IndexSorter
C missing_value=(missing_value)
M selector() Type
M to_string() String
from SortField
F FIELD_DOC SortField
F FIELD_SCORE SortField
F STRING_FIRST Object
F STRING_LAST Object
M comparator_source() FieldComparatorSource
M field() String
M missing_value() Object
M needs_scores() boolean
M optimize_sort_with_indexed_data() boolean
C optimize_sort_with_indexed_data=(optimize_sort_with_indexed_data)
M optimize_sort_with_points() boolean
C optimize_sort_with_points=(optimize_sort_with_points)
M reverse() boolean
M rewrite(searcher) SortField
M type() Type

org.apache.lucene.search.SortedSetSortField

class extends SortField 10 members

SortField for SortedSetDocValues.

A SortedSetDocValues contains multiple values for a field, so sorting with this technique "selects" a value as the representative sort value for the document.

By default, the minimum value in the set is selected as the sort value, but this can be customized. Selectors other than the default do have some limitations to ensure that all selections happen in constant-time for performance.

Like sorting by string, this also supports sorting missing values as first or last, via #setMissingValue(Object).

Constructors

new

new ( String field, boolean reverse )
Java: <init>(String field, boolean reverse)

Creates a sort, possibly in reverse, by the minimum value in the set for the document.

nametypedescription
fieldStringName of field to sort by. Must not be null.
reversebooleanTrue if natural order should be reversed.

new

new ( String field, boolean reverse, SortedSetSelector.Type selector )
Java: <init>(String field, boolean reverse, org.apache.lucene.search.SortedSetSelector.Type selector)

new

new ( String field, boolean reverse, SortedSetSelector.Type selector, Object missing_value )
Java: <init>(String field, boolean reverse, org.apache.lucene.search.SortedSetSelector.Type selector, Object missingValue)

Creates a sort, possibly in reverse, specifying how the sort value from the document's set is selected.

nametypedescription
fieldStringName of field to sort by. Must not be null.
reversebooleanTrue if natural order should be reversed.
selectororg.apache.lucene.search.SortedSetSelector.Typecustom selector type for choosing the sort value from the set.

NOTE: selectors other than SortedSetSelector.Type#MIN require optional codec support.

Instance Methods

equals

boolean equals ( Object obj )
Java: equals(Object obj)

get_comparator

FieldComparator<?> get_comparator ( int num_hits, Pruning pruning )
Java: getComparator(int numHits, org.apache.lucene.search.Pruning pruning)

hash_code

int hash_code ( )
Java: hashCode()

index_sorter

IndexSorter index_sorter ( )
Java: getIndexSorter() · also: get_index_sorter

missing_value=

missing_value= ( Object missing_value )
Java: setMissingValue(Object missingValue) · also: set_missing_value

Set how missing values (the empty set) are sorted.

Note that this must be #STRING_FIRST or #STRING_LAST.

selector

SortedSetSelector.Type selector ( )
Java: getSelector() · also: get_selector

Returns the selector in use for this sort

to_string

String to_string ( )
Java: toString()

Inherited

from SortField

fieldtypenote
FIELD_DOC SortField Represents sorting by document number (index order).
FIELD_SCORE SortField Represents sorting by document score (relevance).
STRING_FIRST Object Pass this to #setMissingValue to have missing string values sort first.
STRING_LAST Object Pass this to #setMissingValue to have missing string values sort last.

comparator_source

FieldComparatorSource comparator_source ( )
Java: getComparatorSource() · also: get_comparator_source

Returns the FieldComparatorSource used for custom sorting

field

String field ( )
Java: getField() · also: get_field

Returns the name of the field. Could return null if the sort is by SCORE or DOC.

Returns: Name of field, possibly null.

missing_value

Object missing_value ( )
Java: getMissingValue() · also: get_missing_value

Return the value to use for documents that don't have a value. A value of null indicates that default should be used.

needs_scores

boolean needs_scores ( )
Java: needsScores()

Whether the relevance score is needed to sort documents.

optimize_sort_with_indexed_data

boolean optimize_sort_with_indexed_data ( )
Java: getOptimizeSortWithIndexedData() · also: get_optimize_sort_with_indexed_data

Returns whether sort optimization should be optimized with indexed data

Returns: whether sort optimization should be optimized with indexed data

optimize_sort_with_indexed_data=

optimize_sort_with_indexed_data= ( boolean optimize_sort_with_indexed_data )
Java: setOptimizeSortWithIndexedData(boolean optimizeSortWithIndexedData) · also: set_optimize_sort_with_indexed_data
Deprecated. should only be used for compatibility with 8.x indices that got created with inconsistent data across fields, or the wrong sort configuration in the index sort

Enables/disables numeric sort optimization to use the indexed data.

Enabled by default. By default, sorting on a numeric field activates point sort optimization that can efficiently skip over non-competitive hits. Sort optimization has a number of requirements, one of which is that SortField.Type matches the Point type with which the field was indexed (e.g. sort on IntPoint field should use SortField.Type.INT). Another requirement is that the same data is indexed with points and doc values for the field.

By default, sorting on a SORTED(_SET) field activates sort optimization that can efficiently skip over non-competitive hits. Sort optimization requires that the same data is indexed with term index and doc values for the field.

nametypedescription
optimize_sort_with_indexed_databooleanproviding false disables the optimization, in cases where these requirements can't be met.

optimize_sort_with_points

boolean optimize_sort_with_points ( )
Java: getOptimizeSortWithPoints() · also: get_optimize_sort_with_points
Deprecated. This is a duplicate method for SortField#getOptimizeSortWithIndexedData.

Returns whether sort optimization should be optimized with points index

Returns: whether sort optimization should be optimized with points index

optimize_sort_with_points=

optimize_sort_with_points= ( boolean optimize_sort_with_points )
Java: setOptimizeSortWithPoints(boolean optimizeSortWithPoints) · also: set_optimize_sort_with_points
Deprecated. should only be used for compatibility with 8.x indices that got created with inconsistent data across fields, or the wrong sort configuration in the index sort. This is a duplicate method for SortField#setOptimizeSortWithIndexedData.

Enables/disables numeric sort optimization to use the Points index.

Enabled by default. By default, sorting on a numeric field activates point sort optimization that can efficiently skip over non-competitive hits. Sort optimization has a number of requirements, one of which is that SortField.Type matches the Point type with which the field was indexed (e.g. sort on IntPoint field should use SortField.Type.INT). Another requirement is that the same data is indexed with points and doc values for the field.

nametypedescription
optimize_sort_with_pointsbooleanproviding false disables the optimization, in cases where these requirements can't be met.

reverse

boolean reverse ( )
Java: getReverse() · also: get_reverse

Returns whether the sort should be reversed.

Returns: True if natural order should be reversed.

rewrite

SortField rewrite ( IndexSearcher searcher )
Java: rewrite(org.apache.lucene.search.IndexSearcher searcher)

Rewrites this SortField, returning a new SortField if a change is made. Subclasses should override this define their rewriting behavior when this SortField is of type SortField.Type#REWRITEABLE

nametypedescription
searcherorg.apache.lucene.search.IndexSearcherIndexSearcher to use during rewriting

Returns: New rewritten SortField, or this if nothing has changed.

Throws

IOException Can be thrown by the rewriting

type

SortField.Type type ( )
Java: getType() · also: get_type

Returns the type of contents in the field.

Returns: One of the constants SCORE, DOC, STRING, INT or FLOAT.

this work for additional information regarding copyright ownership.