Class TextField.TextFieldBuilder

java.lang.Object
com.redis.vl.schema.TextField.TextFieldBuilder
Enclosing class:
TextField

public static class TextField.TextFieldBuilder extends Object
Fluent builder for TextField
  • Method Details

    • name

      public TextField.TextFieldBuilder name(String name)
      Set the field name
      Parameters:
      name - Field name
      Returns:
      This builder
    • alias

      public TextField.TextFieldBuilder alias(String alias)
      Set the field alias
      Parameters:
      alias - Field alias
      Returns:
      This builder
    • withAlias

      public TextField.TextFieldBuilder withAlias(String alias)
      Set the field alias (alternative method)
      Parameters:
      alias - Field alias
      Returns:
      This builder
    • indexed

      public TextField.TextFieldBuilder indexed(boolean indexed)
      Set whether the field is indexed
      Parameters:
      indexed - True if indexed
      Returns:
      This builder
    • sortable

      public TextField.TextFieldBuilder sortable(boolean sortable)
      Set whether the field is sortable
      Parameters:
      sortable - True if sortable
      Returns:
      This builder
    • sortable

      public TextField.TextFieldBuilder sortable()
      Set the field as sortable
      Returns:
      This builder
    • weight

      public TextField.TextFieldBuilder weight(double weight)
      Set the weight for scoring in full-text search
      Parameters:
      weight - Weight value
      Returns:
      This builder
    • withWeight

      public TextField.TextFieldBuilder withWeight(double weight)
      Set the weight for scoring in full-text search (alternative method)
      Parameters:
      weight - Weight value
      Returns:
      This builder
    • noStem

      public TextField.TextFieldBuilder noStem(boolean noStem)
      Set whether to disable stemming
      Parameters:
      noStem - True to disable stemming
      Returns:
      This builder
    • noStem

      public TextField.TextFieldBuilder noStem()
      Disable stemming for this field
      Returns:
      This builder
    • phonetic

      public TextField.TextFieldBuilder phonetic(String phonetic)
      Set the phonetic matcher
      Parameters:
      phonetic - Phonetic matcher (e.g., "dm:en" for Double Metaphone English)
      Returns:
      This builder
    • withPhonetic

      public TextField.TextFieldBuilder withPhonetic(String phonetic)
      Set the phonetic matcher (alternative method)
      Parameters:
      phonetic - Phonetic matcher (e.g., "dm:en" for Double Metaphone English)
      Returns:
      This builder
    • unf

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

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

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

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

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

      Returns:
      This builder
    • indexMissing

      public TextField.TextFieldBuilder 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
    • indexMissing

      public TextField.TextFieldBuilder 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
    • indexEmpty

      public TextField.TextFieldBuilder indexEmpty(boolean indexEmpty)
      Set whether to index empty string values.

      When enabled, allows searching for documents where this field contains an empty string.

      Parameters:
      indexEmpty - True to index empty values
      Returns:
      This builder
    • indexEmpty

      public TextField.TextFieldBuilder indexEmpty()
      Index empty string values (equivalent to indexEmpty(true)).

      When enabled, allows searching for documents where this field contains an empty string.

      Returns:
      This builder
    • build

      public TextField build()
      Build the TextField
      Returns:
      TextField instance