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

- Packages that use FieldComparator
  Package | Description
  --- | ---
  org.apache.lucene.search | Code to search indices.
  org.apache.lucene.search.comparators | Comparators, used to compare hits so as to determine their sort order when collecting the top results with `TopFieldCollector`.

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

    Subclasses of FieldComparator in org.apache.lucene.search
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FieldComparator.RelevanceComparator` Sorts by descending relevance.
    `static class` | `FieldComparator.TermOrdValComparator` Sorts by field's natural Term sort order, using ordinals.
    `static class` | `FieldComparator.TermValComparator` Sorts by field's natural Term sort order.
    `class` | `SimpleFieldComparator<T>` Base `FieldComparator` implementation that is used for all contexts.

    Fields in org.apache.lucene.search declared as FieldComparator
    Modifier and Type | Field and Description
    --- | ---
    `protected FieldComparator<?>[]` | FieldValueHitQueue.`comparators`

    Methods in org.apache.lucene.search that return FieldComparator
    Modifier and Type | Method and Description
    --- | ---
    `FieldComparator<?>` | SortedNumericSortField.`getComparator(int numHits, int sortPos)`
    `FieldComparator<?>` | SortField.`getComparator(int numHits, int sortPos)` Returns the `FieldComparator` to use for sorting.
    `FieldComparator<?>` | SortedSetSortField.`getComparator(int numHits, int sortPos)`
    `FieldComparator<?>[]` | FieldValueHitQueue.`getComparators()`
    `abstract FieldComparator<?>` | FieldComparatorSource.`newComparator(String fieldname, int numHits, int sortPos, boolean reversed)` Creates a comparator for the field in the given index.

  - ### Uses of FieldComparator in org.apache.lucene.search.comparators

    Subclasses of FieldComparator in org.apache.lucene.search.comparators
    Modifier and Type | Class and Description
    --- | ---
    `class` | `DocComparator` Comparator that sorts by asc _doc
    `class` | `DoubleComparator` Comparator based on `Double.compare(double, double)` for `numHits`.
    `class` | `FloatComparator` Comparator based on `Float.compare(float, float)` for `numHits`.
    `class` | `IntComparator` Comparator based on `Integer.compare(int, int)` for `numHits`.
    `class` | `LongComparator` Comparator based on `Long.compare(long, long)` for `numHits`.
    `class` | `NumericComparator<T extends Number>` Abstract numeric comparator for comparing numeric values.

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