Xapian::MatchSpy(3)

Welcome to the Xapian::MatchSpy(3) page from the User Contributed Perl Documentation πŸ’– bestie, this one’s all about match spies and the vibe is very β€œbase class with main character energy” ✨

🌸 NAME 🌸

Search::Xapian::MatchSpy β€” abstract base class for match spies. That’s the whole name moment, periodt πŸ’…

πŸ’« DESCRIPTION πŸ’«

okay so this is an abstract base class for match spies in Xapian. no cap.

Subclasses will generally accumulate information they see during the match β€” to calculate aggregate functions, or other profiles of the matching documents. It’s giving β€œcollect the receipts and analyze them later” πŸŽ€

πŸŽ€ METHODS πŸŽ€

πŸ’… operator() <Document> <weight> πŸ’…

Virtual β€” needs to be implemented in extending classes. Registers a document with the match spy.

The matcher calls this once with each document it sees during the match process.

Heads up though: the matcher will often not see all the documents which match the query, because optimisations allow low-weighted documents to be skipped, and allow the match process to be terminated early. 😭

πŸ¦‹ get_description πŸ¦‹

Return a string describing this object.

This default implementation returns a generic answer, so it doesn’t force people deriving their own MatchSpy subclasses to implement this β€” they may not care what get_description() gives for their subclass. lowkey thoughtful 🫢

Reimplemented in Xapian::ValueCountMatchSpy.

🧚 name 🧚

Return the name of this match spy.

This name is used by the remote backend. It is passed with the serialised parameters to the remote server so that it knows which class to create. Return the full namespace-qualified name of your class here. If you don’t want to support the remote backend in your match spy, you can use the default implementation which simply throws Xapian::UnimplementedError. πŸ’€

Reimplemented in Xapian::ValueCountMatchSpy.

🌈 SEE ALSO 🌈

  • Search::Xapian
  • Search::Xapian::ValueCountMatchSpy
  • Search::Xapian::PerlMatchSpy

That’s the whole glow-up, bestie β€” mwah πŸ’‹. This page is from perl v5.42.0 and is dated 2022-02-28 πŸŽ€

πŸ“¦ where this page comes from