[Xapian-discuss] Where is the get_docid method for perl?
Jim
jim at fayettedigital.com
Sun Oct 7 15:17:12 BST 2007
Olly Betts wrote:
> On Sun, Sep 30, 2007 at 02:26:12PM -0400, Jim wrote:
>
>> I tried the following:
>> my $mset = $enq->get_mset(0, 10);
>> print "Size ". $mset->size()."\n";
>> my %hits;
>> for(my $mit=$mset->begin(); $mit != $mset->end();$mit++) {
>> my %hit;
>> my $doc = $mit->get_document();
>> my $id = $doc->get_docid();
>>
>
> That should be:
>
> my $id = $mit->get_docid();
>
> Is this code taken from an example or documentation? If so, let me know where
> and I'll fix it.
>
No, I think it was my attempt to read the C++ API and apply it to the
perl module since I didn't find any mset* perldocs. I must have been
confused as to what object I was reading about at the time.
Thanks again.
>
>> my $data=$doc->get_data();
>> ...
>> }
>>
>
>
>> I see in the example on perldoc for Search/Xapian that there is a method
>> of the Enquire class named "matches" and it returns a pointer to an
>> unnamed class that includes the get_docid, but there isn't any
>> documentation for it in the API. Am I missing some documentation somewhere?
>>
>
> It's not unnamed - "perldoc Search::Xapian::Enquire" says:
>
> matches <start> <size>
> Takes the start element, and maximum number of elements, and
> returns an array tied to Search::Xapian::MSet::Tied.
>
After I wrote it I found that there were other perldocs than
Search::Xapian. I hadn't realized that initially. It was pretty
frustrating trying to make sense using just that perldoc and the C++
API. ;) Perhaps a see also in the perldoc to point out some of at
least the more interesting documents, like Search::Xapian::Enquire
and Search::Xapian::QueryParser and Search::Xapian::Database.
> Search::Xapian::MSet::Tied doesn't appear to be documented, and I don't
> know much about it (Alex wrote it I think) but looking at the code, its FETCH
> method just returns a Search::Xapian::MSetIterator object for that offset in
> the results.
>
>
>> I searched the wiki for "perl" and got no hits. I searched the xapian
>> web site and it told me it couldn't find the default database.
>>
>
> There was an out-of-date path in xapian.org's omega.conf in CVS which I fixed
> by hand after the 1.0.2 release without realising that file was version
> controlled, so my fix was overwritten by the 1.0.3 upload. Now fixed properly
> - thanks for reporting this.
>
> Cheers,
> Olly
>
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>
>
More information about the Xapian-discuss
mailing list