r44015 - in /branches/upstream/libsearch-xapian-perl/current: ./ Xapian/ examples/ t/
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Sun Sep 13 10:26:51 UTC 2009
Author: carnil-guest
Date: Sun Sep 13 10:26:45 2009
New Revision: 44015
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=44015
Log:
[svn-upgrade] Integrating new upstream version, libsearch-xapian-perl (1.0.16.0)
Modified:
branches/upstream/libsearch-xapian-perl/current/Changes
branches/upstream/libsearch-xapian-perl/current/META.yml
branches/upstream/libsearch-xapian-perl/current/Makefile.PL
branches/upstream/libsearch-xapian-perl/current/README
branches/upstream/libsearch-xapian-perl/current/Xapian.pm
branches/upstream/libsearch-xapian-perl/current/Xapian.xs
branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm
branches/upstream/libsearch-xapian-perl/current/examples/full-searcher.pl
branches/upstream/libsearch-xapian-perl/current/examples/simpleexpand.pl
branches/upstream/libsearch-xapian-perl/current/examples/simplematchdecider.pl
branches/upstream/libsearch-xapian-perl/current/examples/simplesearch.pl
branches/upstream/libsearch-xapian-perl/current/t/03podcoverage.t
branches/upstream/libsearch-xapian-perl/current/t/search.t
Modified: branches/upstream/libsearch-xapian-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Changes?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Changes (original)
+++ branches/upstream/libsearch-xapian-perl/current/Changes Sun Sep 13 10:26:45 2009
@@ -1,8 +1,25 @@
Revision history for Perl extension Search::Xapian.
+1.0.16.0 Thu Sep 10 06:26:08 UTC 2009
+ [Changes contributed by Olly Betts]
+ - Improve documentation of QueryParser::set_default_op() and
+ QueryParser::get_default_op().
+ - examples/: Use MSet::items() (new in 1.0.13.1).
+ - examples/simpleexpand.pl: Remove debug print statement left in by
+ accident.
+ - Add dependency to regenerate Makefile if Xapian.pm changes (since the
+ former contains a version number extracted from the latter).
+ - Add better test coverage for MatchDecider.
+
+1.0.15.0 Wed Aug 26 14:59:31 GMT 2009
+ [Changes contributed by Frank Lichtenheld]
+ - Run POD coverage tests if TEST_POD_COVERAGE is set rather than
+ TEST_POD so that the other POD tests can easily be enabled without
+ enabling the coverage tests.
+
1.0.14.0 Tue Jul 21 16:10:19 GMT 2009
[Changes contributed by Olly Betts]
- - Add handling of C++ exceptions from methods of Document (ticket#284).
+ - Add handling of C++ exceptions from methods of Document (ticket#284).
1.0.13.1 Tue May 26 13:51:18 GMT 2009
[Changes contributed by Olly Betts]
Modified: branches/upstream/libsearch-xapian-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/META.yml?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/META.yml (original)
+++ branches/upstream/libsearch-xapian-perl/current/META.yml Sun Sep 13 10:26:45 2009
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Search-Xapian
-version: 1.0.14.0
+version: 1.0.16.0
version_from: Xapian.pm
installdirs: site
requires:
Modified: branches/upstream/libsearch-xapian-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Makefile.PL?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Makefile.PL (original)
+++ branches/upstream/libsearch-xapian-perl/current/Makefile.PL Sun Sep 13 10:26:45 2009
@@ -113,15 +113,16 @@
# AUTHOR => 'Alex Bowley <kilinrax at cpan.org>') : ()),
$libsvar => $libs, # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'CC' => $CC,
+ 'CC' => $CC,
'CCFLAGS' => $CCFLAGS,
- 'LD' => $LD,
+ 'LD' => $LD,
'INC' => $inc, # e.g., '-I/usr/include/other'
- 'XSOPT' => '-C++',
- # 'typemap' is implicitly added to this list.
- 'TYPEMAPS' => ['perlobject.map'],
+ 'XSOPT' => '-C++',
+ # 'typemap' is implicitly added to this list.
+ 'TYPEMAPS' => ['perlobject.map'],
# Add "make check" as alias for "make test".
- 'depend' => { 'check' => 'test' },
+ # Make sure that we rebuild the Makefile if the version number changes.
+ 'depend' => { 'check' => 'test', 'Makefile' => 'Xapian.pm' },
);
my $VERSION = "unknown";
Modified: branches/upstream/libsearch-xapian-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/README?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/README (original)
+++ branches/upstream/libsearch-xapian-perl/current/README Sun Sep 13 10:26:45 2009
@@ -1,4 +1,4 @@
-Search::Xapian version 1.0.14.0
+Search::Xapian version 1.0.16.0
===============================
This is Search::Xapian, a Perl XS frontend to the Xapian C++ search library.
Modified: branches/upstream/libsearch-xapian-perl/current/Xapian.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Xapian.pm?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.pm (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.pm Sun Sep 13 10:26:45 2009
@@ -4,7 +4,7 @@
use strict;
use warnings;
-our $VERSION = '1.0.14.0';
+our $VERSION = '1.0.16.0';
use Exporter 'import';
Modified: branches/upstream/libsearch-xapian-perl/current/Xapian.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Xapian.xs?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian.xs (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian.xs Sun Sep 13 10:26:45 2009
@@ -60,52 +60,48 @@
};
class perlMatchDecider : public Xapian::MatchDecider {
- private:
- SV *callback;
- public:
- perlMatchDecider(SV *func) {
- callback = newSVsv(func);
- }
-
- ~perlMatchDecider() {
- SvREFCNT_dec(callback);
- }
-
- bool operator()(const Xapian::Document &doc) const {
- dSP;
- Document *pdoc;
-
- ENTER;
- SAVETMPS;
-
- PUSHMARK(SP);
-
- pdoc = new Document();
- *pdoc = doc;
-
- SV *arg;
- arg = sv_newmortal();
- sv_setref_pv(arg, "Search::Xapian::Document", (void *)pdoc);
- XPUSHs(arg);
-
- PUTBACK;
-
- int count = call_sv(callback, G_SCALAR);
-
- SPAGAIN;
- if (count != 1)
- croak("callback function should return 1 value, got %d", count);
-
- SV *decide_result = POPs;
- int decide_actual_result = SvIV(decide_result);
-
- PUTBACK;
-
- FREETMPS;
- LEAVE;
-
- return decide_actual_result;
- }
+ SV *callback;
+
+ public:
+ perlMatchDecider(SV *func) {
+ callback = newSVsv(func);
+ }
+
+ ~perlMatchDecider() {
+ SvREFCNT_dec(callback);
+ }
+
+ bool operator()(const Xapian::Document &doc) const {
+ dSP;
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(SP);
+
+ SV *arg = sv_newmortal();
+
+ Document *pdoc = new Document(doc);
+ sv_setref_pv(arg, "Search::Xapian::Document", (void *)pdoc);
+ XPUSHs(arg);
+
+ PUTBACK;
+
+ int count = call_sv(callback, G_SCALAR);
+
+ SPAGAIN;
+ if (count != 1)
+ croak("callback function should return 1 value, got %d", count);
+
+ int decide_actual_result = POPi;
+
+ PUTBACK;
+
+ FREETMPS;
+ LEAVE;
+
+ return decide_actual_result;
+ }
};
MODULE = Search::Xapian PACKAGE = Search::Xapian
Modified: branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm (original)
+++ branches/upstream/libsearch-xapian-perl/current/Xapian/QueryParser.pm Sun Sep 13 10:26:45 2009
@@ -82,12 +82,19 @@
=item set_default_op <operator>
-Set default operator for joining elements. Useful values are
-OP_AND and OP_OR. See L<Search::Xapian> for descriptions of these constants.
+Set the default operator.
+
+This operator is used to combine non-filter query items when no
+explicit operator is used.
+
+The most useful values for this are OP_OR (the default) and OP_AND.
+OP_NEAR and OP_PHRASE can also be useful.
+
+See L<Search::Xapian> for descriptions of these constants.
=item get_default_op
-Returns the default operator for joining elements.
+Returns the current default operator.
=item set_database <database>
Modified: branches/upstream/libsearch-xapian-perl/current/examples/full-searcher.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/examples/full-searcher.pl?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/examples/full-searcher.pl (original)
+++ branches/upstream/libsearch-xapian-perl/current/examples/full-searcher.pl Sun Sep 13 10:26:45 2009
@@ -131,7 +131,7 @@
$mset->get_matches_estimated();
print "Results 1-$msize:\n";
- foreach my $m (tie_mset($mset)) {
+ foreach my $m ($mset->items()) {
printf "#%u: Score %u%%: %s\n",
$m->get_rank() + 1,
$m->get_percent(),
@@ -143,11 +143,3 @@
print STDERR "Exception: $@\n";
exit 1;
}
-
-# Helper function which allows a Search::Xapian::MSet to be accessed as if it
-# were a Perl array.
-sub tie_mset {
- my @a;
- tie( @a, 'Search::Xapian::MSet::Tied', shift );
- return @a;
-}
Modified: branches/upstream/libsearch-xapian-perl/current/examples/simpleexpand.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/examples/simpleexpand.pl?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/examples/simpleexpand.pl (original)
+++ branches/upstream/libsearch-xapian-perl/current/examples/simpleexpand.pl Sun Sep 13 10:26:45 2009
@@ -50,7 +50,6 @@
my $reldocs = Search::Xapian::RSet->new();
foreach my $did (@ARGV[$sep_index + 1 .. $#ARGV]) {
$reldocs->add_document($did);
- print "rel: $did\n";
}
# Parse the query string to produce a Xapian::Query object.
@@ -73,9 +72,7 @@
printf "%i results found.\n", $mset->get_matches_estimated();
printf "Results 1-%i:\n", $mset->size();
- # In 1.0.13.0 and newer you'll be able to replace this with:
- # foreach my $m ($mset->matches()) {
- foreach my $m (tie_mset($mset)) {
+ foreach my $m ($mset->items()) {
printf "%i: %i%% docid=%i [%s]\n", $m->get_rank() + 1, $m->get_percent(), $m->get_docid(), $m->get_document()->get_data();
}
}
@@ -86,7 +83,7 @@
if ($last > 4) {
$last = 4;
}
- foreach my $m ((tie_mset($mset))[0..$last]) {
+ foreach my $m (($mset->items())[0..$last]) {
$reldocs->add_document($m->get_docid());
}
}
@@ -104,9 +101,3 @@
print STDERR "Exception: $@\n";
exit(1);
}
-
-sub tie_mset {
- my @a;
- tie( @a, 'Search::Xapian::MSet::Tied', shift );
- return @a;
-}
Modified: branches/upstream/libsearch-xapian-perl/current/examples/simplematchdecider.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/examples/simplematchdecider.pl?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/examples/simplematchdecider.pl (original)
+++ branches/upstream/libsearch-xapian-perl/current/examples/simplematchdecider.pl Sun Sep 13 10:26:45 2009
@@ -70,9 +70,7 @@
printf "%i results found.\n", $mset->get_matches_estimated();
printf "Results 1-%i:\n", $mset->size();
- # In 1.0.13.0 and newer you'll be able to replace this with:
- # foreach my $m ($mset->matches()) {
- foreach my $m (tie_mset($mset)) {
+ foreach my $m ($mset->items()) {
printf "%i: %i%% docid=%i [%s]\n", $m->get_rank() + 1, $m->get_percent(), $m->get_docid(), $m->get_document()->get_data();
}
};
@@ -80,9 +78,3 @@
print STDERR "Exception: $@\n";
exit(1);
}
-
-sub tie_mset {
- my @a;
- tie( @a, 'Search::Xapian::MSet::Tied', shift );
- return @a;
-}
Modified: branches/upstream/libsearch-xapian-perl/current/examples/simplesearch.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/examples/simplesearch.pl?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/examples/simplesearch.pl (original)
+++ branches/upstream/libsearch-xapian-perl/current/examples/simplesearch.pl Sun Sep 13 10:26:45 2009
@@ -58,9 +58,7 @@
printf "%i results found.\n", $mset->get_matches_estimated();
printf "Results 1-%i:\n", $mset->size();
- # In 1.0.13.0 and newer you'll be able to replace this with:
- # foreach my $m ($mset->matches()) {
- foreach my $m (tie_mset($mset)) {
+ foreach my $m ($mset->items()) {
printf "%i: %i%% docid=%i [%s]\n", $m->get_rank() + 1, $m->get_percent(), $m->get_docid(), $m->get_document()->get_data();
}
};
@@ -68,9 +66,3 @@
print STDERR "Exception: $@\n";
exit(1);
}
-
-sub tie_mset {
- my @a;
- tie( @a, 'Search::Xapian::MSet::Tied', shift );
- return @a;
-}
Modified: branches/upstream/libsearch-xapian-perl/current/t/03podcoverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/t/03podcoverage.t?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/t/03podcoverage.t (original)
+++ branches/upstream/libsearch-xapian-perl/current/t/03podcoverage.t Sun Sep 13 10:26:45 2009
@@ -2,6 +2,6 @@
eval "use Test::Pod::Coverage 1.04";
plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
-plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+plan skip_all => 'set TEST_POD_COVERAGE to enable this test' unless $ENV{TEST_POD_COVERAGE};
all_pod_coverage_ok({also_private => [qr/[^\d][0123]$/]});
Modified: branches/upstream/libsearch-xapian-perl/current/t/search.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsearch-xapian-perl/current/t/search.t?rev=44015&op=diff
==============================================================================
--- branches/upstream/libsearch-xapian-perl/current/t/search.t (original)
+++ branches/upstream/libsearch-xapian-perl/current/t/search.t Sun Sep 13 10:26:45 2009
@@ -6,7 +6,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More;
-BEGIN { plan tests => 109 };
+BEGIN { plan tests => 114 };
use Search::Xapian qw(:ops);
#########################
@@ -88,9 +88,9 @@
is( $match, $matches->end(), "match set returns correct endpoint");
my $rset;
-ok( $rset = Search::Xapian::RSet->new(), "relevance set returned ok" );
+ok( $rset = Search::Xapian::RSet->new(), "relevance set created ok" );
$rset->add_document( 1 );
-ok( $rset->contains( 1 ), "document added to relevance setsuccessfully" );
+ok( $rset->contains( 1 ), "document added to relevance set successfully" );
ok( !$rset->contains( 2 ), "relevance set correctly fails to match document it does not contain" );
$rset->remove_document( 1 );
ok( !$rset->contains( 1 ), "document removed from relevance set successfully" );
@@ -102,8 +102,24 @@
ok( $matches3 = $enq->get_mset(0, 10, 11, $rset), "get_mset with check_at_least and rset" );
is( $matches3->size, $matches->size, "rset and check_at_least don't change mset size" );
+my $d;
# This was generating a warning converting "0" to an RSet object:
-ok( $matches3 = $enq->get_mset(0, 10, sub { return 1; }), "get_mset with matchdecider" );
+ok( $matches3 = $enq->get_mset(0, 10,
+ sub { $d = scalar @_; return $_[0]->get_value(0) ne ""; }),
+ "get_mset with matchdecider" );
+ok( defined $d, "matchdecider was called" );
+ok( $d == 1, "matchdecider got an argument" );
+
+sub mdecider {
+ $d = scalar @_;
+ return $_[0]->get_value(0) ne "";
+}
+
+$d = undef;
+ok( $matches3 = $enq->get_mset(0, 10, \&mdecider),
+ "get_mset with named matchdecider function" );
+ok( defined $d, "matchdecider was called" );
+ok( $d == 1, "matchdecider got an argument" );
my $eset;
ok( $eset = $enq->get_eset( 10, $rset ), "can get expanded terms set" );
More information about the Pkg-perl-cvs-commits
mailing list