Class: MmEsSearch::Api::Query::TextQuery

Inherits:
AbstractQuery show all
Defined in:
lib/mm_es_search/api/query/text_query.rb

Instance Method Summary collapse

Methods inherited from AbstractQuery

#es_abs_field, #mongo_abs_field, #path_and_index, #to_filter

Instance Method Details

#to_es_queryObject



28
29
30
31
32
33
34
35
36
# File 'lib/mm_es_search/api/query/text_query.rb', line 28

def to_es_query
  
  params = self.attributes.except("_type", "field", "path")
  field  = self.field
  field  = "#{path}.#{field}" if path
  
  return {:text => {field => params}}

end

#to_mongo_query(options = {}) ⇒ Object



22
23
24
25
26
# File 'lib/mm_es_search/api/query/text_query.rb', line 22

def to_mongo_query(options = {})
  
  raise "TextQuery doesn't support mongo execution"
  
end