On 3/9/07, D. Krmpotic <[EMAIL PROTECTED]> wrote:
> Hi!
>
>
> Suppose I have many articles in a database and I want to know how many
> times each search term appears in each one of them. Where do I start?
Here is an example;
require 'rubygems'
require 'ferret'
index = Ferret::I.new
index << {:content => 'one two three'}
index << {:content => 'no 3 here'}
index << {:content => 'three three three'}
index.reader.term_docs_for(:content, 'three').each do |doc, freq|
puts "three appeared #{freq} times in document #{doc}"
end
--
Dave Balmain
http://www.davebalmain.com/
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk