Module: ActsAsFerret::MoreLikeThis::IndexMethods
- Included in:
- LocalIndex
- Defined in:
- lib/acts_as_ferret/more_like_this.rb
Instance Method Summary collapse
-
#build_more_like_this_query(key, id, options) ⇒ Object
TODO to allow morelikethis for unsaved records, we have to give the unsaved record’s data to this method.
Instance Method Details
#build_more_like_this_query(key, id, options) ⇒ Object
TODO to allow morelikethis for unsaved records, we have to give the unsaved record’s data to this method. check how this will work out via drb…
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/acts_as_ferret/more_like_this.rb', line 66 def build_more_like_this_query(key, id, ) [:similarity, :analyzer].each { |sym| [sym] = [sym].constantize.new } ferret_index.synchronize do # avoid that concurrent writes close our reader ferret_index.send(:ensure_reader_open) reader = ferret_index.send(:reader) term_freq_map = retrieve_terms(key, id, reader, ) priority_queue = create_queue(term_freq_map, reader, ) create_query(key, priority_queue, ) end end |