I just started using Ferret and I successfully indexed some documents. I
can search this index using the following code:

index = Index::Index.new(:path => path)
index.search_each("something") do |doc, score|
        print "##{doc} #{index[doc]['url']} - #{score}"
        print "\n"
end

However, when I try to use Search::Searcher and QueryParser I don't get
any results. I tried the following code:

queryparser = QueryParser.new()
searcher = Searcher.new(path)
queryparser.fields = searcher.reader.fields
searcher.search(queryparser.parse("something"))

I index all my documents as follows:

index = Index::Index.new(:path => path, :analyzer =>
Analysis::RegExpAnalyzer.new(/./, false))
index << { :title => title, :url => link, :body  => page }

What am I doing wrong?

Thanks!

-- Jeffrey Gelens


_______________________________________________
Ferret-talk mailing list
Ferret-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to