module CloudSesame::Query::DSL::Operators

Public Instance Methods

begin_with(value, options = {})
Alias for: prefix
near(value, options = {}) click to toggle source

NEAR: creates a single NEAR node

# File lib/cloud_sesame/query/dsl/operators.rb, line 8
def near(value, options = {})
        _build_operator AST::Near, options, value
end
Also aliased as: sloppy
phrase(value, options = {}) click to toggle source

PHRASE: creates a single PHRASE node

# File lib/cloud_sesame/query/dsl/operators.rb, line 25
def phrase(value, options = {})
        _build_operator AST::Phrase, options, value
end
prefix(value, options = {}) click to toggle source

PREFIX: creates a single PREFIX node

# File lib/cloud_sesame/query/dsl/operators.rb, line 16
def prefix(value, options = {})
        _build_operator AST::Prefix, options, value
end
Also aliased as: start_with, begin_with
sloppy(value, options = {})
Alias for: near
start_with(value, options = {})
Alias for: prefix
term(value, options = {}) click to toggle source

TERM: creates a single TERM node

# File lib/cloud_sesame/query/dsl/operators.rb, line 31
def term(value, options = {})
        _build_operator AST::Term, options, value
end

Private Instance Methods

_build_operator(klass, options, value) click to toggle source
# File lib/cloud_sesame/query/dsl/operators.rb, line 37
def _build_operator(klass, options, value)
        node = klass.new _context, options
        node << AST::Literal.new(nil, value)
        node
end