/*
 *  call-seq:
 *     index_reader.term_count(field) -> int
 *
 *  Same return a count of the number of terms in the field
 */
static VALUE
frt_ir_term_count(VALUE self, VALUE rfield)
{
    IndexReader *ir = (IndexReader *)DATA_PTR(self);
    TermEnum *te = ir_terms(ir, frt_field(rfield));
    int count = 0;
    while (te->next(te)) {
        count++;
    }
    te->close(te);
    return INT2FIX(count);
}