123456789_123456789_123456789_123456789_123456789_

Class: Redis::Commands::Search::RangePredicate

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 numeric-range predicate rendering (@field:[min max]).

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, min, max) ⇒ RangePredicate

Parameters:

  • field (String)

    the numeric field name

  • min (Numeric, String)

    the lower bound

  • max (Numeric, String)

    the upper bound

[ GitHub ]

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

def initialize(field, min, max)
  super(field)
  @min = min
  @max = max
end

Instance Method Details

#to_sString

Returns:

  • (String)

    the query-string fragment, e.g. (@price:[10 20])

[ GitHub ]

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

def to_s
  "(@#{@field}:[#{@min} #{@max}])"
end