Class: Ferret::Index::TermVector::TVTerm

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

Overview

Summary

The TVTerm class holds the term information for each term in a TermVector. That is it holds the term’s text and its positions in the document. You can use those positions to reference the offsets for the term.

Example

tv = index_reader.term_vector(:content)
tv_term = tv.find {|tvt| tvt.term = "fox"}
offsets = tv_term.positions.collect {|pos| tv.offsets[pos]}