org.hibernate.search.query.dsl.sort.impl

## Class ConnectedSortFieldContext

- java.lang.Object
- - org.hibernate.search.query.dsl.sort.impl.AbstractConnectedSortContext
  - - org.hibernate.search.query.dsl.sort.impl.ConnectedSortAdditionalSortFieldContext
    - - org.hibernate.search.query.dsl.sort.impl.ConnectedSortFieldContext

- All Implemented Interfaces:
    SortAdditionalSortFieldContext, SortFieldContext, SortMissingValueContext<SortFieldContext>, SortOrder<SortFieldContext>, SortTermination

      public class ConnectedSortFieldContext
      extends ConnectedSortAdditionalSortFieldContext
      implements SortFieldContext, SortMissingValueContext<SortFieldContext>

  Author:
    Emmanuel Bernard emmanuel@hibernate.org

- - ### Field Summary

    - ### Fields inherited from class org.hibernate.search.query.dsl.sort.impl.AbstractConnectedSortContext

      `queryContext, states`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectedSortFieldContext(QueryBuildingContext queryContext, SortFieldStates states)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SortFieldContext` | `asc()` Sort in ascending order.
    `Sort` | `createSort()` Return the Lucene `Sort` corresponding to the requested sort.
    `SortFieldContext` | `desc()` Sort in descending order.
    `SortMissingValueContext<SortFieldContext>` | `onMissingValue()` Describe how to treat missing values when doing the sorting.
    `SortFieldContext` | `sortFirst()` Put documents with missing values first in the sorting.
    `SortFieldContext` | `sortLast()` Put documents with missing values last in the sorting.
    `SortFieldContext` | `use(Object value)` When documents are missing a value on the sort field, use the given value instead.

    - ### Methods inherited from class org.hibernate.search.query.dsl.sort.impl.ConnectedSortAdditionalSortFieldContext

      `andByDistance, andByField, andByField, andByIndexOrder, andByNative, andByNative, andByScore`

    - ### Methods inherited from class org.hibernate.search.query.dsl.sort.impl.AbstractConnectedSortContext

      `getQueryContext, getStates`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.hibernate.search.query.dsl.sort.SortAdditionalSortFieldContext

      `andByDistance, andByField, andByField, andByIndexOrder, andByNative, andByNative, andByScore`

- - ### Constructor Detail

    - #### ConnectedSortFieldContext

          public ConnectedSortFieldContext(QueryBuildingContext queryContext,
                                           SortFieldStates states)

  - ### Method Detail

    - #### asc

          public SortFieldContext asc()

      Description copied from interface: `SortOrder`
      Sort in ascending order.
      Specified by:
        `asc` in interface `SortOrder<SortFieldContext>`

    - #### desc

          public SortFieldContext desc()

      Description copied from interface: `SortOrder`
      Sort in descending order.
      Specified by:
        `desc` in interface `SortOrder<SortFieldContext>`

    - #### createSort

          public Sort createSort()

      Description copied from interface: `SortTermination`
      Return the Lucene `Sort` corresponding to the requested sort.
      Specified by:
        `createSort` in interface `SortTermination`

    - #### onMissingValue

          public SortMissingValueContext<SortFieldContext> onMissingValue()

      Description copied from interface: `SortFieldContext`
      Describe how to treat missing values when doing the sorting.
      Specified by:
        `onMissingValue` in interface `SortFieldContext`

    - #### sortLast

          public SortFieldContext sortLast()

      Description copied from interface: `SortMissingValueContext`
      Put documents with missing values last in the sorting.

      This instruction is independent of whether the sort is being ascending or descending.

      Specified by:
        `sortLast` in interface `SortMissingValueContext<SortFieldContext>`

    - #### sortFirst

          public SortFieldContext sortFirst()

      Description copied from interface: `SortMissingValueContext`
      Put documents with missing values first in the sorting.

      This instruction is independent of whether the sort is being ascending or descending.

      Specified by:
        `sortFirst` in interface `SortMissingValueContext<SortFieldContext>`

    - #### use

          public SortFieldContext use(Object value)

      Description copied from interface: `SortMissingValueContext`
      When documents are missing a value on the sort field, use the given value instead.

      Lucene sort API limits this feature to numeric fields. As Hibernate Search sorts are currently based on the Lucene API underneath, this is only available for numeric fields for all the indexing services, Elasticsearch included.

      Field bridges, if any, will be ignored. Thus the actual numeric value must be provided.

      Specified by:
        `use` in interface `SortMissingValueContext<SortFieldContext>`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved