123456789_123456789_123456789_123456789_123456789_

Class: Redis::Commands::Search::TagEqualityPredicate

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

Overview

A tag-equality predicate rendering (@field:{value}).

Constant Summary

Predicate - Inherited

TAG_ESCAPE_PATTERN, TAG_SPECIAL_CHARACTERS, TEXT_ESCAPE_PATTERN, TEXT_SPECIAL_CHARACTERS

Class Method Summary

Instance Attribute Summary

Predicate - Inherited

Instance Method Summary

Predicate - Inherited

#to_s,
#escape_tag

Escape query metacharacters in a literal tag value, including whitespace.

#escape_text

Escape query metacharacters in a literal text value, keeping spaces as term separators.

Constructor Details

.new(field, value) ⇒ TagEqualityPredicate

Parameters:

  • field (String)

    the tag field name

  • value (String)

    the tag value to match

[ GitHub ]

  
# File 'lib/redis/commands/modules/search/query.rb', line 657

def initialize(field, value)
  super(field)
  @value = value
end

Instance Method Details

#to_sString

Returns:

  • (String)

    the query-string fragment, e.g. (@color:{red})

[ GitHub ]

  
# File 'lib/redis/commands/modules/search/query.rb', line 663

def to_s
  "(@#{@field}:{#{escape_tag(@value)}})"
end