Module: BlacklightMoreLikeThis::SolrDocumentExtension

Defined in:
lib/blacklight_more_like_this/solr_document_extension.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(some_class) ⇒ Object



3
4
5
6
7
# File 'lib/blacklight_more_like_this/solr_document_extension.rb', line 3

def self.included some_class
  some_class.after_initialize do
    solr_response.send(:extend, RSolr::Ext::Response::MoreLikeThis) unless solr_response.is_a? RSolr::Ext::Response::MoreLikeThis
  end
end

Instance Method Details

#more_like_thisObject



9
10
11
12
13
# File 'lib/blacklight_more_like_this/solr_document_extension.rb', line 9

def more_like_this
  return unless solr_response and solr_response.respond_to? :more_like

  solr_response.more_like(self).map { |x| self.class.new(x, solr_response) }
end