Method: Doing::StringQuery#to_phrase_query

Defined in:
lib/doing/string/query.rb

#to_phrase_queryObject

Returns a phrase query (elastic search) representation of the object as a phrase parser.

Returns:

  • Phrase query representation of the object.



93
94
95
96
97
98
# File 'lib/doing/string/query.rb', line 93

def to_phrase_query
  parser = PhraseParser::QueryParser.new
  transformer = PhraseParser::QueryTransformer.new
  parse_tree = parser.parse(self)
  transformer.apply(parse_tree).to_elasticsearch
end