Xapian::Database(3)
π NAME π
Search::Xapian::Database β the search database object, bestie. Around here it's also Xapian::Database(3), from the User Contributed Perl Documentation. Hi, welcome to the group chat β¨
β¨ DESCRIPTION β¨
Okay so this class represents a Xapian database for searching. If you're trying to index stuff, go see Search::Xapian::WritableDatabase for an object suitable for indexing. To actually perform searches, this class works with the Search::Xapian::Query object. It's giving search-era main character energy, no cap π
π METHODS π
new <database>β class constructor, slay. It can take either a path to an existing database or another database class as the first parameter.cloneβ returns a clone of this class. A little copy-paste moment, but make it official π«Άadd_databaseβ add an existing database (or group of databases) to those accessed by this object. Group project, but make it databases.reopenβ this re-opens the database(s) to the latest available version(s). It can be used either to make sure the latest results are returned, or to recover from aXapian::DatabaseModifiedError. Refresh button energy, honestly.closeβ close the database. Heads up: this also implies acommit()unless a transaction is in progress. So don't just ghost it, bestie πenquire [<query>]β returns a newSearch::Xapian::Enquireobject. Any extra parameters are passed toset_query. Cute.get_doccountβ returns the number of documents indexed in this database. Count 'em πget_lastdocidβ returns the id of the last used document.get_doclength <doc_id>β returns the length of a given document.get_document <doc_id>β returns aSearch::Xapian::Documentobject for the given document.get_avlengthβ get the average length of the documents in the database. Average is a vibe.get_termfreq <term>β get the number of documents in the database indexed by a given term.term_exists <term>β returns true if this term exists in the database, or false otherwise. A little true/false moment πget_descriptionβ return a description of this object.get_spelling_suggestionβ returns a suggested spelling correction. The autocorrect friend we all need πallterms_begin [<prefix>]β returns aSearch::Xapian::TermIteratoriterating over the termlist for the entire database. If the optional prefix argument is non-empty, only terms starting with that string are returned.allterms_end [<prefix>]β returns aSearch::Xapian::TermIteratorpointing to the end of the termlist corresponding toallterms_begin.termlist_begin <docid>β returns aSearch::Xapian::TermIteratorpointing to the start of the termlist for a given document.termlist_end <docid>β returns aSearch::Xapian::TermIteratorpointing to the end of the termlist for a given document.positionlist_begin <docid> <term>β returns aSearch::Xapian::PositionIteratorpointing to the start of the position list for a given term in the given document.positionlist_end <docid> <term>β returns aSearch::Xapian::PositionIteratorpointing to the end of the position list for a given term in the given document.postlist_begin <term>β returns aSearch::Xapian::PostingIteratorpointing to the start of the posting list for a given term.postlist_end <term>β returns aSearch::Xapian::PostingIteratorpointing to the end of the posting list for a given term.keep_aliveβ send a "keep-alive" to remote databases to stop them timing out. Not me sending a lil ping so the remote DB doesn't ghost us πΈget_collection_freq <term>β get the number of elements indexed by a certain term.
π SEE ALSO π
Search::XapianSearch::Xapian::EnquireSearch::Xapian::WritableDatabase
Go read those too, bestie β it's the friend group π
mwah π this iconic page is from perl v5.42.0, dated 2022-02-28, and it's Xapian::Database(3) β periodt.
π¦ where this page comes from
- opensuse-leap 16.0: perl-Search-Xapian 1.2.25.5-bp160.1.7 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Search-Xapian 1.2.25.5-bp160.1.7 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Search-Xapian 1.2.25.5-bp160.1.7 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Search-Xapian 1.2.25.5-bp160.1.7 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms