Class NumericField.NumericFieldBuilder

java.lang.Object
com.redis.vl.schema.NumericField.NumericFieldBuilder
Enclosing class:
NumericField

public static class NumericField.NumericFieldBuilder extends Object
Fluent builder for NumericField
  • Method Details

    • name

      Set the field name.
      Parameters:
      name - The name for this field
      Returns:
      This builder for chaining
    • alias

      Set the field alias.
      Parameters:
      alias - The alias for this field
      Returns:
      This builder for chaining
    • withAlias

      public NumericField.NumericFieldBuilder withAlias(String alias)
      Set the field alias (alias for alias() method).
      Parameters:
      alias - The alias for this field
      Returns:
      This builder for chaining
    • indexed

      public NumericField.NumericFieldBuilder indexed(boolean indexed)
      Set whether this field should be indexed.
      Parameters:
      indexed - True to index this field, false otherwise
      Returns:
      This builder for chaining
    • sortable

      public NumericField.NumericFieldBuilder sortable(boolean sortable)
      Set whether this field should be sortable.
      Parameters:
      sortable - True to make this field sortable, false otherwise
      Returns:
      This builder for chaining
    • sortable

      Make this field sortable (equivalent to sortable(true)).
      Returns:
      This builder for chaining
    • unf

      public NumericField.NumericFieldBuilder unf(boolean unf)
      Set whether to use un-normalized form for sorting

      UNF disables normalization when sorting, preserving original values. Only applies when sortable=true.

      NOTE: Jedis doesn't support sortableUNF() for NumericField yet, so this flag is stored but not passed to Redis.

      Parameters:
      unf - True to disable normalization for sorting
      Returns:
      This builder for chaining
    • unf

      Use un-normalized form for sorting (equivalent to unf(true))

      UNF disables normalization when sorting, preserving original values. Only applies when sortable=true.

      NOTE: Jedis doesn't support sortableUNF() for NumericField yet, so this flag is stored but not passed to Redis.

      Returns:
      This builder for chaining
    • indexMissing

      public NumericField.NumericFieldBuilder indexMissing(boolean indexMissing)
      Set whether to index missing values (documents without this field).

      When enabled, allows searching for documents where this field is missing using the ismissing() filter.

      Parameters:
      indexMissing - True to index missing values
      Returns:
      This builder for chaining
    • indexMissing

      public NumericField.NumericFieldBuilder indexMissing()
      Index missing values (equivalent to indexMissing(true)).

      When enabled, allows searching for documents where this field is missing using the ismissing() filter.

      Returns:
      This builder for chaining
    • build

      public NumericField build()
      Build the NumericField instance.
      Returns:
      The configured NumericField
      Throws:
      IllegalArgumentException - if the field name is null or empty