Xapian::Document(3pm) User Contributed Perl Documentation Xapian::Document(3pm)NAME
Search::Xapian::Document - Document object
DESCRIPTION
This class represents a document in a Xapian database.
METHODS
new Class constructor.
clone
Return a clone of this class.
get_value (value_no)
Returns the value by the assigned number.
add_value <value_no> <value>
Set a value by value number.
remove_value <value_no>
Removes the value with the assigned number.
clear_values
Clear all set values.
get_data
Return all document data.
set_data <data>
Set all document data. This can be anything you like.
add_posting <term> <position> [<weight>]
Adds a term at the given position. weight defaults to 1.
remove_posting <term> <position> [<weight]
Removes a term from the given position. weight defaults to 1.
add_term <term> [<weight>]
Adds a term without positional information. weight defaults to 1.
add_boolean_term <term>
Adds a term intended for boolean filtering (its wdf contribution will be 0).
remove_term <term>
Removes a term without positional information.
clear_terms
Remove all terms from the document.
termlist_count
Returns number of terms in the document.
termlist_begin
Iterator for the terms in this document. Returns a Search::Xapian::TermIterator.
termlist_end
Equivalent end iterator for termlist_begin(). Returns a Search::Xapian::TermIterator.
values_count
Return number of defined values for this document.
values_begin
Return a Search::Xapian::ValueIterator pointing at the start of the values in this document.
values_end
Return a Search::Xapian::ValueIterator pointing at the end of the values in this document.
get_description
Return a description of this object.
SEE ALSO
Search::Xapian::Database
perl v5.14.2 2012-05-09 Xapian::Document(3pm)
Check Out this Related Man Page
Xapian::Database(3pm) User Contributed Perl Documentation Xapian::Database(3pm)NAME
Search::Xapian::Database - Search database object
DESCRIPTION
This class represents a Xapian database for searching. See Search::Xapian::WritableDatabase for an object suitable for indexing. To
perform searches, this class works with the Search::Xapian::Query object.
METHODS
new <database>
Class constructor. Can either take a path to an existing database or another database class as the first parameter
clone
Return a clone of this class.
add_database
Add an existing database (or group of databases) to those accessed by this object.
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 a Xapian::DatabaseModifiedError.
close
Close the database. This also implies a commit() unless a transaction is in progress.
enquire [<query>]
Returns a new Search::Xapian::Enquire object. Any extra parameters are passed to set_query.
get_doccount
Returns the number of document indexed in this database.
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 a Search::Xapian::Document object for the given document.
get_avlength
Get the average length of the documents in the database.
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.
get_description
return a description of this object.
get_spelling_suggestion
returns a suggested spelling correction.
allterms_begin [<prefix>]
Returns a Search::Xapian::TermIterator iterating over the termlist for the the entire database. If the optional prefix argument is
non-empty, only terms starting with that string are returned.
allterms_end [<prefix>]
Returns a Search::Xapian::TermIterator pointing to the end of the termlist corresponding to allterms_begin.
termlist_begin <docid>
Returns a Search::Xapian::TermIterator pointing to the start of the termlist for a given document.
termlist_end <docid>
Returns a Search::Xapian::TermIterator pointing to the end of the termlist for a given document.
positionlist_begin <docid> <term>
Returns a Search::Xapian::PositionIterator pointing to the start of the position list for a given term in the given document.
positionlist_end <docid> <term>
Returns a Search::Xapian::PositionIterator pointing to the end of the position list for a given term in the given document.
postlist_begin <term>
Returns a Search::Xapian::PostingIterator pointing to the start of the posting list for a given term.
postlist_end <term>
Returns a Search::Xapian::PostingIterator pointing 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.
get_collection_freq <term>
Get the number of elements indexed by a certain term.
SEE ALSO
Search::Xapian,Search::Xapian::Enquire,Search::Xapian::WritableDatabase
perl v5.14.2 2012-05-09 Xapian::Database(3pm)