/usr/lib/perl5/Search/Xapian/Query.pm is in libsearch-xapian-perl 1.2.8.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | package Search::Xapian::Query;
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]->get_description() }, # FIXME: perhaps unwise?
'fallback' => 1;
sub new {
my $class = shift;
my $query;
if( @_ == 1 ) {
$query = new1(@_);
} else {
my $op = $_[0];
if( $op !~ /^\d+$/ ) {
Carp::croak( "USAGE: $class->new('term') or $class->new(OP, <args>)" );
}
if( $op == 8 ) { # FIXME: 8 is OP_VALUE_RANGE; eliminate hardcoded literal
if( @_ != 4 ) {
Carp::croak( "USAGE: $class->new(OP_VALUE_RANGE, VALNO, START, END)" );
}
$query = new4range( @_ );
} elsif( $op == 9 ) { # FIXME: OP_SCALE_WEIGHT
if( @_ != 3 ) {
Carp::croak( "USAGE: $class->new(OP_SCALE_WEIGHT, QUERY, FACTOR)" );
}
$query = new3scale( @_ );
} elsif( $op == 11 || $op == 12 ) { # FIXME: OP_VALUE_GE, OP_VALUE_LE; eliminate hardcoded literals
if( @_ != 3 ) {
Carp::croak( "USAGE: $class->new(OP_VALUE_[GL]E, VALNO, LIMIT)" );
}
$query = new3range( @_ );
} else {
$query = newN( @_ );
}
}
bless $query, $class;
return $query;
}
sub new_term {
my $class = shift;
my $query;
if (@_ < 1 or @_ > 3) {
Carp::carp( "new_term takes 1, 2 or 3 arguments only" );
}
my ($term, $wqf, $pos) = @_;
$wqf = 1 unless defined $wqf;
$pos = 0 unless defined $pos;
$query = new1weight($term, $wqf, $pos);
bless $query, $class;
return $query;
}
sub get_terms {
my $self = shift;
my @terms;
my $q=$self->get_terms_begin;
while ($q ne $self->get_terms_end) {
push @terms,$q->get_termname;
$q++;
}
return @terms;
}
1;
|