Class: ElasticsearchQueryParser::Grammar::Presenters::Term

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticsearch_query_parser/grammar/presenters/term.rb

Instance Method Summary collapse

Constructor Details

#initialize(term) ⇒ Term

Returns a new instance of Term.



8
9
10
# File 'lib/elasticsearch_query_parser/grammar/presenters/term.rb', line 8

def initialize(term)
  @term = term.to_s
end

Instance Method Details

#to_elasticsearchObject



12
13
14
15
16
17
# File 'lib/elasticsearch_query_parser/grammar/presenters/term.rb', line 12

def to_elasticsearch
  {
    query: term,
    operator: "and"
  }
end