123456789_123456789_123456789_123456789_123456789_

Class: Redis::Commands::Search::TagField

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Field
Instance Chain:
self, Field
Inherits: Redis::Commands::Search::Field
Defined in: lib/redis/commands/modules/search/field.rb

Overview

A TAG field, indexing one or more delimited tag tokens.

Class Method Summary

Field - Inherited

.new

Build a field definition.

Instance Attribute Summary

Instance Method Summary

Field - Inherited

#to_args

Render this field as the array of FT.CREATE SCHEMA tokens.

Constructor Details

.new(name, query = nil, **options) ⇒ TagField

Build a TAG field.

Parameters:

  • name (String, Symbol)

    the document attribute the field indexes

  • query (Query, nil) (defaults to: nil)

    a query the field is bound to, enabling #eq

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :separator (String)

    the tag separator character (+SEPARATOR+)

  • :case_sensitive (Boolean)

    keep tag casing (+CASESENSITIVE+)

[ GitHub ]

  
# File 'lib/redis/commands/modules/search/field.rb', line 72

def initialize(name, query = nil, **options)
  super(name, :tag, query, **options)
end

Instance Method Details

#eq(value) ⇒ Query

Add a tag-equality predicate (+@field:value+) to the bound query.

Parameters:

  • value (String)

    the tag to match

Returns:

  • (Query)

    the bound query with the predicate added

[ GitHub ]

  
# File 'lib/redis/commands/modules/search/field.rb', line 80

def eq(value)
  query.add_predicate(TagEqualityPredicate.new(@alias_name || name, value))
end