Interface FieldSortMissingValueBehaviorStep<N>

Type Parameters:
N - The type of the next step (returned by first(), for example).

public interface FieldSortMissingValueBehaviorStep<N>
The step in a sort definition where the behavior on missing values can be set.
Author:
Emmanuel Bernard emmanuel@hibernate.org
  • Method Summary

    Modifier and Type
    Method
    Description
    Put documents with missing values first in the sorting.
    Give documents with missing values the highest value when sorting.
    Put documents with missing values last in the sorting.
    Give documents with missing values the lowest value when sorting.
    default N
    use(Object value)
    When documents are missing a value on the sort field, use the given value instead.
    default N
    use(Object value, ValueConvert convert)
    Deprecated.
    use(Object value, ValueModel valueModel)
    When documents are missing a value on the sort field, use the given value instead.
  • Method Details

    • last

      N last()
      Put documents with missing values last in the sorting.

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

      Returns:
      The next step.
    • first

      N first()
      Put documents with missing values first in the sorting.

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

      Returns:
      The next step.
    • highest

      N highest()
      Give documents with missing values the highest value when sorting.

      This puts documents with missing values last when using ascending order, or first when using descending order.

      Returns:
      The next step.
    • lowest

      N lowest()
      Give documents with missing values the lowest value when sorting.

      This puts documents with missing values first when using ascending order, or last when using descending order.

      Returns:
      The next step.
    • use

      default N use(Object value)
      When documents are missing a value on the sort field, use the given value instead.

      This method will apply DSL converters to value before Hibernate Search attempts to interpret it as a field value. See ValueModel.MAPPING.

      Parameters:
      value - The value to use as a default when a document is missing a value on the sort field.
      Returns:
      The next step.
      Throws:
      SearchException - If the field is not numeric.
    • use

      @Deprecated default N use(Object value, ValueConvert convert)
      Deprecated.
      When documents are missing a value on the sort field, use the given value instead.
      Parameters:
      value - The value to use as a default when a document is missing a value on the sort field.
      convert - Controls how the value should be converted before Hibernate Search attempts to interpret it as a field value. See ValueConvert.
      Returns:
      The next step.
      Throws:
      SearchException - If the field is not numeric.
    • use

      N use(Object value, ValueModel valueModel)
      When documents are missing a value on the sort field, use the given value instead.
      Parameters:
      value - The value to use as a default when a document is missing a value on the sort field.
      valueModel - The model value, determines how the value should be converted before Hibernate Search attempts to interpret it as a field value. See ValueModel.
      Returns:
      The next step.
      Throws:
      SearchException - If the field is not numeric.