Class: Sunspot::Search::MoreLikeThisSearch

Inherits:
AbstractSearch show all
Defined in:
lib/sunspot/search/more_like_this_search.rb

Instance Attribute Summary

Attributes inherited from AbstractSearch

#facets, #groups, #query

Instance Method Summary collapse

Methods inherited from AbstractSearch

#add_date_facet, #add_field_facet, #add_field_group, #add_query_facet, #build, #dynamic_facet, #execute!, #facet, #facet_response, #group, #group_response, #highlights_for, #hits, #initialize, #inspect, #query_time, #results, #total

Methods included from HitEnumerable

#data_accessor_for, #each_hit_with_result, #hits, #populate_hits, #verified_hits

Constructor Details

This class inherits a constructor from Sunspot::Search::AbstractSearch

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
# File 'lib/sunspot/search/more_like_this_search.rb', line 10

def execute
  if @query.more_like_this.fields.empty?
    @setup.all_more_like_this_fields.each do |field|
      @query.more_like_this.add_field(field)
    end
  end
  super
end

#request_handlerObject



19
20
21
# File 'lib/sunspot/search/more_like_this_search.rb', line 19

def request_handler
  super || :mlt
end