Class: MmEsSearch::Api::Highlight::ResultHighlight

Inherits:
Object
  • Object
show all
Includes:
MongoMapper::EmbeddedDocument
Defined in:
lib/mm_es_search/api/highlight/result_highlight.rb

Instance Method Summary collapse

Instance Method Details

#to_es_queryObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/mm_es_search/api/highlight/result_highlight.rb', line 25

def to_es_query

  highlight_params = self.attributes.except("fields", "pre_tags", "post_tags")
  highlight_params.merge!(:fields => fields.map(&:to_es_query)) unless fields.empty?
  highlight_params.merge!(:pre_tags => pre_tags) unless pre_tags.empty?
  highlight_params.merge!(:post_tags => ) unless .empty?
  
  return field? ? {field => highlight_params.except('field')} : highlight_params

end

#to_mongo_queryObject



19
20
21
22
23
# File 'lib/mm_es_search/api/highlight/result_highlight.rb', line 19

def to_mongo_query

  raise "to_mongo_query not implemented for ResultHighlight"

end