The acts_as_ferret documentation says find_by_content returns an 
instance of SearchResults, but I see this error when I try to use the 
results.

undefined method `total_hits' for []:Array

Here is the link to the documentation:

http://projects.jkraemer.net/acts_as_ferret/rdoc/classes/FerretMixin/Acts/ARFerret/ClassMethods.html#M000010

But here is the actual code:

            result = []
            hits = index_searcher.search(query, options)
            hits.each do |hit, score|
              id = index_searcher.reader.get_document(hit)[:id]
              begin
                res = self.find(id)
                result << res if res
                logger.debug "result id: #{id}, result: #{res}"
              rescue
                logger.debug "no data for id #{id}"
              end
            end
            return result

What's wrong?  Do I need another version of the plugin?

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to