my $mset = $enq->get_mset($nstart,$nrecords); for(my $mit=$mset->begin(); $mit != $mset->end();$mit++) { my $doc = $mit->get_document(); my $dat = $doc->get_data(); my $id = $doc->get_docid(); } [Fri Jan 20 10:35:06 2012] newmail.cgi: Can't locate auto/Search/Xapian/Document/get_docid.al in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at newmail.cgi line 286 From the api at http://xapian.org/docs/apidoc/html/classXapian_1_1Document.html docid Xapian::Document::get_docid ( ) const Get the document id which is associated with this document (if any). NB If multiple databases are being searched together, then this will be the document id in the individual database, not the merged database! Returns: If this document came from a database, return the document id in that database. Otherwise, return 0 (in Xapian 1.0.22/1.2.4 or later; prior to this the returned value was uninitialised). CPAN: Module::CoreList loaded ok (v2.18) Search::Xapian is up to date (1.2.8.0). I think the libraries are still at 1.2.7. Any ideas? Jim.
On 01/20/2012 11:00 AM, Jim Lynch wrote:> my $mset = $enq->get_mset($nstart,$nrecords); > > for(my $mit=$mset->begin(); $mit != $mset->end();$mit++) { > > my $doc = $mit->get_document(); > my $dat = $doc->get_data(); > my $id = $doc->get_docid(); > } > > [Fri Jan 20 10:35:06 2012] newmail.cgi: Can't locate > auto/Search/Xapian/Document/get_docid.al in @INC (@INC contains: > /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 > /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 > /usr/share/perl/5.10 /usr/local/lib/site_perl .) at newmail.cgi line 286 > > From the api at > http://xapian.org/docs/apidoc/html/classXapian_1_1Document.html > > docid Xapian::Document::get_docid ( ) const > > Get the document id which is associated with this document (if any). > > NB If multiple databases are being searched together, then this will > be the document id in the individual database, not the merged database! > > Returns: > If this document came from a database, return the document id in > that database. Otherwise, return 0 (in Xapian 1.0.22/1.2.4 or later; > prior to this the returned value was uninitialised). > > > CPAN: Module::CoreList loaded ok (v2.18) > Search::Xapian is up to date (1.2.8.0). > > I think the libraries are still at 1.2.7. > > Any ideas? > > Jim. > > _______________________________________________ > Xapian-discuss mailing list > Xapian-discuss at lists.xapian.org > http://lists.xapian.org/mailman/listinfo/xapian-discuss >I think I answered my own question. I found the docs for the old XS (or that's what the man page says) interface and it's using a different method of getting matches using my @matches = $enq->matches(0, 10); And each element of the array has a get_docid method. Docs found at: http://xapian.org/docs/bindings/perl/Search/Xapian.html Are there newer? This mentions sortable_serialize. Jim.
On Fri, Jan 20, 2012 at 11:00:07AM -0500, Jim Lynch wrote:> [Fri Jan 20 10:35:06 2012] newmail.cgi: Can't locate > auto/Search/Xapian/Document/get_docid.al in @INC (@INC contains: > /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 > /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 > /usr/local/lib/site_perl .) at newmail.cgi line 286 > > From the api at > http://xapian.org/docs/apidoc/html/classXapian_1_1Document.html > > docid Xapian::Document::get_docid ( ) const > > Get the document id which is associated with this document (if any). > > NB If multiple databases are being searched together, then this will be > the document id in the individual database, not the merged database! > > Returns: > If this document came from a database, return the document id in > that database. Otherwise, return 0 (in Xapian 1.0.22/1.2.4 or later; > prior to this the returned value was uninitialised).The XS bindings need someone to add a wrapper by hand for new C++ methods. Nobody has added a wrapper for this method, and the "Can't locate <something>.al" is the cryptic way Perl responds to calling a non-existing method in this case. It's trivial to add a wrapper in this case, and I've done so in SVN 1.2 branch (r16334), so this will be fixed in 1.2.9. In trunk the Perl bindings are SWIG-generated, and this method is already wrapped automatically. Cheers, Olly
On Sat, 2012-01-21 at 09:56 +0000, Olly Betts wrote:> On Sat, Jan 21, 2012 at 04:26:41AM -0500, Jim Lynch wrote: > > Thanks, but I'm just a little confused. I thought all we had today were > > SWIG generated Perl bindings?? > > No. Search::Xapian is hand-coded XS in 1.2.x (and earlier). Since > 1.2.4 there are also SWIG-generated Perl bindings in xapian-bindings, > but we decided to make the final switch with a new release series, as > it may cause minor incompatibilities with existing Perl code which uses > Xapian.The CPAN module is the hand-coded XS. You will need to build or get packages for "xapian-bindings" to get the SWIG version. Both versions live in the "Search::Xapian" namespace so you can install one or other but not both. /Tim.