Search::Xapian::ValueCountMatchSpy(3pm)

Search::Xapian::ValueCountMatchSpy3pm

Class for counting the frequencies of values in the matching documents.

Usage

  use Search::Xapian qw(:all);
  my $db = Search::Xapian::Database->new( '[DATABASE DIR]' );
  my $enq = $db->enquire( '[QUERY TERM]' );
  my $spy = Search::Xapian::ValueCountMatchSpy->new(0);
  $enq->add_matchspy($spy);
  my $mset = $enq->get_mset(0, 10, 10000);
  print "Match spy registered " . $spy->get_total() . " documents\n";
  my $end = $spy->values_end();
  for (my $it = $spy->values_begin(); $it != $end; $it++) {
    print $it->get_termname() . " - " . $it->get_termfreq();
  }

Overview

Class for counting the frequencies of values in the matching documents. Wraps Xapian::ValueCountMatchSpy

Methods

new

Constructor. Either takes no parameters, or a single valueno parameter identifying the slot.

get_total

Return the total number of documents tallied.

values_begin

Get an iterator over the values seen in the slot.

values_end

End iterator corresponding to values_begin().

top_values_begin <maxvalues>

Get an iterator over the most frequent values seen in the slot.

top_values_end <maxvalues>

End iterator corresponding to top_values_begin().

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

From libsearch-xapian-perl 1.2.25.5-3+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.