{"record":{"id":"5583d8dbee7a674d","repo":"redis/redis-rb","slug":"invalid-options-for-text-field-invalid-options","errorCode":null,"errorMessage":"Invalid options for text field: #{invalid_options.join(', ')}","messagePattern":"Invalid options for text field: #(.+?)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/redis/commands/modules/search/schema.rb","lineNumber":95,"sourceCode":"\n        # Add a {TextField} to the schema.\n        #\n        # @param [String, Symbol] name the document attribute the field indexes\n        # @option options [Numeric] :weight the field's scoring weight\n        # @option options [Boolean] :sortable allow sorting by the field\n        # @option options [Boolean] :no_index do not index the field\n        # @option options [String] :as an alias for the field\n        # @option options [String] :phonetic phonetic matcher\n        # @option options [Boolean] :no_stem disable stemming\n        # @option options [Boolean] :index_empty index empty values\n        # @option options [Boolean] :withsuffixtrie build a suffix trie\n        # @return [Array<Field>] the updated field list\n        # @raise [ArgumentError] if an unknown option key is given\n        def text_field(name, **options)\n          valid_options = %i[weight sortable no_index as phonetic no_stem index_empty index_missing withsuffixtrie]\n          invalid_options = options.keys - valid_options\n          if invalid_options.any?\n            raise ArgumentError, \"Invalid options for text field: #{invalid_options.join(', ')}\"\n          end\n\n          @fields << TextField.new(name, **options)\n        end\n\n        # Add a {NumericField} to the schema.\n        #\n        # @param [String, Symbol] name the document attribute the field indexes\n        # @return [Array<Field>] the updated field list\n        def numeric_field(name, **options)\n          @fields << NumericField.new(name, **options)\n        end\n\n        # Add a {TagField} to the schema.\n        #\n        # @param [String, Symbol] name the document attribute the field indexes\n        # @option options [Boolean] :sortable allow sorting by the field\n        # @option options [Boolean] :no_index do not index the field","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/commands/modules/search/schema.rb#L77-L113","documentation":"Error \"Invalid options for text field: #{invalid_options.join(', ')}\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/commands/modules/search/schema.rb:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the listed invalid options from the text field definition; only the supported text-field options are allowed.","Check the option names for typos against the text field documentation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2ba9010b91dab9e0fde1fbae3a9aae003f8bc307","analyzedAt":"2026-08-23T03:54:57.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}