search for: term_docs_for

Displaying 7 results from an estimated 7 matches for "term_docs_for".

2007 May 29
0
index#term_docs returns no docs / term_docs_for does
...into an issue with Ferret::Index::IndexReader#term_docs. As I understand it, index_reader.term_docs should return a term-document enumerator for the entire index: index_reader.term_docs => empty set However, I''m getting an empty set. Interestingly enough, the following: index_reader.term_docs_for(:name, ''coffee'') => lots of documents Is returning plenty of documents. I''m expecting #term_docs to return an enumerator that allows me to step through the entire index - any ideas on what I''m doing wrong? I''m using acts_as_ferret and I''m...
2007 Mar 20
2
Strange Results For Term Frequencies
...s while examining the term frequency of one of my indexed documents. The indexed terms seem to vary for the very same document depending on the presence or absence of completely unrelated operations in the code, so the resulting term frequency changes, too. I repeatedly call ''index_reader.term_docs_for'' for the only document I''ve indexed in the snippet below, but depending on the presence of the statement ''dummy_count = 0'' or some formatting code for the output the resulting term frequencies change from correct answers to wrong ones. Sometimes terms are not fou...
2007 Apr 06
3
Count frequency of term in a specific document?
Is there any way to count the frequency of specific term in one document? I can''t find any method... Do you? -- Posted via http://www.ruby-forum.com/.
2007 Apr 03
2
How can I count frequency of terms in a document?
Hi, there. I need some help. Is there a way to count frequencies of terms in a document on Ferret? I know that Ferret has IndexReader#terms_docs_for method which counts all documents. I need to count frequencies of terms in a specific document. Some way?? -- Posted via http://www.ruby-forum.com/.
2007 Mar 09
2
Newbie
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? Thank you very much! David -- Posted via http://www.ruby-forum.com/.
2007 Feb 16
8
term vector blues
...39;'zlib'' fields=Ferret::Index::FieldInfos.new fields.add_field :text, :store=>:no#, :index=>:omit_norms i = Ferret::I.new :field_infos=>fields #:path=>''temp_index'' 20.times{ i << {:text=>`man gcc`[0..135000]} } #i.close_writer r=i.reader #r.term_docs_for(:text, "example") r.term_vector(0,:text) example output: $ ruby tvtest.rb Reformatting gcc(1), please wait... Reformatting gcc(1), please wait... Reformatting gcc(1), please wait... Reformatting gcc(1), please wait... Reformatting gcc(1), please wait... Reformatting gcc(1), please wa...
2007 Mar 09
5
memory leak in index build?
...::Index::IndexReader.new dir i.max_doc.times{|n| i.term_vector(n,:data).terms \ .inject(0){|sum,tvt| tvt.positions.size } > 1_000_000 and puts "heinous term count for #{i[n][:name]}" } seenterms=Set[] begin i.terms(:data).each{|term,df| seenterms.include? term and next i.term_docs_for(:data,term) seenterms << term } rescue Exception raise end