Module: RSolr::Ext::Response::MoreLikeThis

Defined in:
lib/rsolr-ext/response/more_like_this.rb

Instance Method Summary collapse

Instance Method Details

#more_like(document) ⇒ Object



5
6
7
8
9
10
# File 'lib/rsolr-ext/response/more_like_this.rb', line 5

def more_like document
  mlt = more_like_this[document.id]
  return [] unless mlt and mlt['docs']

  mlt['docs'].map { |x| x.extend RSolr::Ext::Doc }
end

#more_like_thisObject



12
13
14
15
16
# File 'lib/rsolr-ext/response/more_like_this.rb', line 12

def more_like_this
  return {} unless self[:moreLikeThis]
  
  self[:moreLikeThis]
end