| Search-Xapian documentation | Contained in the Search-Xapian distribution. |
Search::Xapian::Document - Document object
This class represents a document in a Xapian database.
Class constructor.
Return a clone of this class.
Returns the value by the assigned number.
Set a value by value number.
Removes the value with the assigned number.
Clear all set values.
Return all document data.
Set all document data. This can be anything you like.
Adds a term at the given position. weight defaults to 1.
Removes a term from the given position. weight defaults to 1.
Adds a term without positional information. weight defaults to 1.
Adds a term intended for boolean filtering (its wdf contribution will be 0).
Removes a term without positional information.
Remove all terms from the document.
Returns number of terms in the document.
Iterator for the terms in this document. Returns a Search::Xapian::TermIterator.
Equivalent end iterator for termlist_begin(). Returns a Search::Xapian::TermIterator.
Return number of defined values for this document.
Return a Search::Xapian::ValueIterator pointing at the start of the values in this document.
Return a Search::Xapian::ValueIterator pointing at the end of the values in this document.
Return a description of this object.
| Search-Xapian documentation | Contained in the Search-Xapian distribution. |
package Search::Xapian::Document; use 5.006; use strict; use warnings; use Carp; require DynaLoader; our @ISA = qw(DynaLoader); # Preloaded methods go here. # In a new thread, copy objects of this class to unblessed, undef values. sub CLONE_SKIP { 1 } use overload '=' => sub { $_[0]->clone() }, 'fallback' => 1; sub clone() { my $self = shift; my $class = ref( $self ); my $copy = new2( $self ); bless $copy, $class; return $copy; } sub new() { my $class = shift; my $document; my $invalid_args; if( scalar(@_) == 0 ) { $document = new1(); } elsif( scalar(@_) == 1 and ref( $_[1] ) eq $class ) { $document = new2(@_); } else { $invalid_args = 1; } if( $invalid_args ) { Carp::carp( "USAGE: $class->new(), $class->new(\$document)" ); exit; } bless $document, $class; return $document; } 1; __END__