Class CreateArgs

java.lang.Object
io.quarkus.redis.datasource.search.CreateArgs
All Implemented Interfaces:
RedisCommandExtraArguments

public class CreateArgs extends Object implements RedisCommandExtraArguments
Represents the argument of the ft.create command.
  • Constructor Details

    • CreateArgs

      public CreateArgs()
  • Method Details

    • onHash

      public CreateArgs onHash()
      Enables indexing hash objects.
      Returns:
      the current CreateArgs
    • onJson

      public CreateArgs onJson()
      Enable indexing JSON documents. To index JSON, you must have the RedisJSON module installed.
      Returns:
      the current CreateArgs
    • prefixes

      public CreateArgs prefixes(String... prefixes)
      Tells the index which keys it should index. You can add several prefixes to index. Because the argument is optional, the default is * (all keys).
      Parameters:
      prefixes - the prefix of the keys
      Returns:
      the current CreateArgs
    • filter

      public CreateArgs filter(String filter)
      Sets a filter expression with the full RediSearch aggregation expression language. It is possible to use @__key to access the key that was just added/changed. A field can be used to set field name by passing 'FILTER @indexName=="myindexname"'.
      Parameters:
      filter - the filter
      Returns:
      the current CreateArgs
    • language

      public CreateArgs language(String language)
      If set, indicates the default language for documents in the index. Default to English.
      Parameters:
      language - the language
      Returns:
      the current CreateArgs
    • languageField

      public CreateArgs languageField(String languageField)
      Set a document attribute used as the document language. A stemmer is used for the supplied language during indexing. If an unsupported language is sent, the command returns an error.
      Parameters:
      languageField - the language field
      Returns:
      the current CreateArgs
    • score

      public CreateArgs score(double score)
      Set the default score for documents in the index. Default score is 1.0.
      Parameters:
      score - the score
      Returns:
      the current CreateArgs
    • scoreField

      public CreateArgs scoreField(String field)
      Sets the document attribute that you use as the document rank based on the user ranking. Ranking must be between 0.0 and 1.0. If not set, the default score is 1.
      Parameters:
      field - the field
      Returns:
      the current CreateArgs
    • payloadField

      public CreateArgs payloadField(String field)
      Sets the document attribute that you use as a binary safe payload string to the document that can be evaluated at query time by a custom scoring function or retrieved to the client.
      Parameters:
      field - the field
      Returns:
      the current CreateArgs
    • maxTextFields

      public CreateArgs maxTextFields()
      Forces RediSearch to encode indexes as if there were more than 32 text attributes, which allows you to add additional attributes (beyond 32) using FT.ALTER. For efficiency, RediSearch encodes indexes differently if they are created with less than 32 text attributes.
      Returns:
      the current CreateArgs
    • noOffsets

      public CreateArgs noOffsets()
      Sets to not store term offsets for documents. It saves memory, but does not allow exact searches or highlighting. It implies NOHL.
      Returns:
      the current CreateArgs
    • temporary

      public CreateArgs temporary(Duration duration)
      Creates a lightweight temporary index that expires after a specified period of inactivity. The internal idle timer is reset whenever the index is searched or added to. Because such indexes are lightweight, you can create thousands of such indexes without negative performance implications and, therefore, you should consider using SKIPINITIALSCAN to avoid costly scanning.

      When dropped, a temporary index does not delete the hashes as they may have been indexed in several indexes. Adding the DD flag deletes the hashes as well.

      Parameters:
      duration - the duration
      Returns:
      the current CreateArgs
    • noHl

      public CreateArgs noHl()
      Conserves storage space and memory by disabling highlighting support. If set, the corresponding byte offsets for term positions are not stored. NOHL is also implied by NOOFFSETS.
      Returns:
      the current CreateArgs
    • noFields

      public CreateArgs noFields()
      Does not store attribute bits for each term. It saves memory, but it does not allow filtering by specific attributes.
      Returns:
      the current CreateArgs
    • noFreqs

      public CreateArgs noFreqs()
      Avoids saving the term frequencies in the index. It saves memory, but does not allow sorting based on the frequencies of a given term within the document.
      Returns:
      the current CreateArgs
    • stopWords

      public CreateArgs stopWords(String... words)
      Sets the index with a custom stop word list, to be ignored during indexing and search time.
      Parameters:
      words - the stop word list
      Returns:
      the current CreateArgs
    • skipInitialScan

      public CreateArgs skipInitialScan()
      If set, does not scan and index.
      Returns:
      the current CreateArgs
    • indexedField

      public CreateArgs indexedField(String field, String alias, FieldType type, FieldOptions options)
      Adds a field to the schema.
      Parameters:
      field - the field
      alias - the alias, can be null
      type - the field type
      options - the additional options
      Returns:
      the current CreateArgs
    • indexedField

      public CreateArgs indexedField(String field, FieldType type, FieldOptions options)
      Adds a field to the schema.
      Parameters:
      field - the field
      type - the field type
      options - the additional options
      Returns:
      the current CreateArgs
    • indexedField

      public CreateArgs indexedField(String field, FieldType type)
      Adds a field to the schema.
      Parameters:
      field - the field
      type - the field type
      Returns:
      the current CreateArgs
    • indexedField

      public CreateArgs indexedField(String field, String alias, FieldType type)
      Adds a field to the schema.
      Parameters:
      field - the field
      alias - the alias, can be null
      type - the field type
      Returns:
      the current CreateArgs
    • toArgs

      public List<Object> toArgs()
      Specified by:
      toArgs in interface RedisCommandExtraArguments
      Returns:
      the list of arguments.