## Uses of Class
org.apache.lucene.search.SortField

- Packages that use SortField
  Package | Description
  --- | ---
  org.apache.lucene.document | The logical representation of a `Document` for indexing and searching.
  org.apache.lucene.index | Code to maintain and access indices.
  org.apache.lucene.search | Code to search indices.

- - ### Uses of SortField in org.apache.lucene.document

    Methods in org.apache.lucene.document that return SortField
    Modifier and Type | Method and Description
    --- | ---
    `static SortField` | LatLonDocValuesField.`newDistanceSort(String field, double latitude, double longitude)` Creates a SortField for sorting by distance from a location.
    `static SortField` | XYDocValuesField.`newDistanceSort(String field, float x, float y)` Creates a SortField for sorting by distance from a location.
    `static SortField` | FeatureField.`newFeatureSort(String field, String featureName)` Creates a SortField for sorting by the value of a feature.

  - ### Uses of SortField in org.apache.lucene.index

    Methods in org.apache.lucene.index that return SortField
    Modifier and Type | Method and Description
    --- | ---
    `abstract SortField` | SortFieldProvider.`readSortField(DataInput in)` Reads a SortField from serialized bytes

    Methods in org.apache.lucene.index with parameters of type SortField
    Modifier and Type | Method and Description
    --- | ---
    `static void` | SortFieldProvider.`write(SortField sf, DataOutput output)` Writes a SortField to a DataOutput
    `abstract void` | SortFieldProvider.`writeSortField(SortField sf, DataOutput out)` Writes a SortField to a DataOutput This is used to record index sort information in segment headers

  - ### Uses of SortField in org.apache.lucene.search

    Subclasses of SortField in org.apache.lucene.search
    Modifier and Type | Class and Description
    --- | ---
    `class` | `SortedNumericSortField` SortField for `SortedNumericDocValues`.
    `class` | `SortedSetSortField` SortField for `SortedSetDocValues`.

    Fields in org.apache.lucene.search declared as SortField
    Modifier and Type | Field and Description
    --- | ---
    `static SortField` | SortField.`FIELD_DOC` Represents sorting by document number (index order).
    `static SortField` | SortField.`FIELD_SCORE` Represents sorting by document score (relevance).
    `SortField[]` | TopFieldDocs.`fields` The fields which were used to sort results by.
    `protected SortField[]` | FieldValueHitQueue.`fields` Stores the sort criteria being used.

    Methods in org.apache.lucene.search that return SortField
    Modifier and Type | Method and Description
    --- | ---
    `SortField[]` | Sort.`getSort()` Representation of the sort criteria.
    `SortField` | DoubleValuesSource.`getSortField(boolean reverse)` Create a sort field based on the value of this producer
    `SortField` | LongValuesSource.`getSortField(boolean reverse)` Create a sort field based on the value of this producer
    `SortField` | SortField.Provider.`readSortField(DataInput in)`
    `SortField` | SortedSetSortField.Provider.`readSortField(DataInput in)`
    `SortField` | SortedNumericSortField.Provider.`readSortField(DataInput in)`
    `SortField` | SortField.`rewrite(IndexSearcher searcher)` Rewrites this SortField, returning a new SortField if a change is made.

    Methods in org.apache.lucene.search with parameters of type SortField
    Modifier and Type | Method and Description
    --- | ---
    `static <T extends FieldValueHitQueue.Entry> FieldValueHitQueue<T>` | FieldValueHitQueue.`create(SortField[] fields, int size)` Creates a hit queue sorted by the given list of fields.
    `void` | Sort.`setSort(SortField... fields)` Sets the sort to the given criteria in succession: the first SortField is checked first, but if it produces a tie, then the second SortField is used to break the tie, etc.
    `void` | Sort.`setSort(SortField field)` Sets the sort to the given criteria.
    `void` | SortField.Provider.`writeSortField(SortField sf, DataOutput out)`
    `void` | SortedSetSortField.Provider.`writeSortField(SortField sf, DataOutput out)`
    `void` | SortedNumericSortField.Provider.`writeSortField(SortField sf, DataOutput out)`

    Constructors in org.apache.lucene.search with parameters of type SortField
    Constructor and Description
    `Sort(SortField... fields)` Sets the sort to the given criteria in succession: the first SortField is checked first, but if it produces a tie, then the second SortField is used to break the tie, etc.
    `Sort(SortField field)` Sorts by the criteria in the given SortField.
    `TopFieldDocs(TotalHits totalHits, ScoreDoc[] scoreDocs, SortField[] fields)` Creates one of these objects.

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.