Class: Ferret::Index::TermEnum

Inherits:
Object
  • Object
show all
Defined in:
ext/r_index.c

Overview

Summary

The TermEnum object is used to iterate through the terms in a field. To get a TermEnum you need to use the IndexReader#terms(field) method.

Example

te = index_reader.terms(:content)

te.each {|term, doc_freq| puts "#{term} occurred #{doc_freq} times" }

# or you could do it like this;
te = index_reader.terms(:content)

while te.next?
  puts "#{te.term} occurred in #{te.doc_freq} documents in the index"
end