Xapian:...atchSpy(3)

πŸ’– NAME πŸ’–

Search::Xapian::ValueCountMatchSpy is the class for counting the frequencies of values in the matching documents, bestie. This is the Xapian:...atchSpy(3) page from the User Contributed Perl Documentation, and it's giving very β€œtiny spy that tallies things” energy, iykyk πŸ’…

✨ SYNOPSIS ✨

Okay so here's the whole flow, fr fr:

  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();
  }

🌸 DESCRIPTION 🌸

Class for counting the frequencies of values in the matching documents. Periodt. It wraps Xapian::ValueCountMatchSpy, so that's the whole cute little setup πŸ¦‹

πŸŽ€ METHODS πŸŽ€

  • new β€” Constructor. It either takes no parameters, or a single valueno parameter that identifies the slot. Choose your fighter.
  • get_total β€” Returns the total number of documents tallied. That's the count, no cap.
  • values_begin β€” Get an iterator over the values seen in the slot.
  • values_end β€” The end iterator that corresponds to values_begin().
  • top_values_begin <maxvalues> β€” Get an iterator over the most frequent values seen in the slot.
  • top_values_end <maxvalues> β€” The end iterator that corresponds to top_values_begin().

πŸ”₯ SEE ALSO πŸ”₯

  • Search::Xapian
  • Search::Xapian::MatchSpy

Go give them a lil look if you're feeling nosy πŸ‘€


This page is brought to you by perl v5.42.0, dated 2022-02-28 β€” mwah, bestie, go count some values! πŸ’–βœ¨

πŸ“¦ where this page comes from