Xapian::Termiterator is not working the way it used to with perl
Jim <[email protected]> Sat, 11 Sep 2021 16:41:30 -0400
| Newsgroups | gmane.comp.search.xapian.general |
|---|---|
| Message-ID | <8dae4cf1.AMcAAGJPjycAAAAAAAAAALFigUYAAV8RcXcAAAAAAAoIrQBhPRR8@mailjet.com> |
I update my 1.4.7 xapian to the latest 1.4.18. One of my apps stopped
working. I traced it to this bit of code:
my $eterm = $enq->get_matching_terms_end($id);
my $bterm = $enq->get_matching_terms_begin($id);
for(my $xit=$bterm;$xit != $eterm;++$xit) {
my $foo ="$xit";
print LOG ref $foo;
my $re = Data::Dumper->new([$xit]);
print LOG "xit ".$re->Dump;
$re = Data::Dumper->new([$foo]);
print LOG "foo ".$re->Dump;
flush LOG;
$foo =~s/^Z//;
$foo =~s/^A//;
In the past, $foo was a string containing a term from the document. It
is not any longer and I don't know how to get the term from a TermIterator.
Here's the log:
xit $VAR1 = bless( {}, 'Xapian::TermIterator' );
foo $VAR1 = 'Xapian::TermIterator=HASH(0x55c91b34a4e8)';
I saw this at
https://xapian.org/docs/bindings/perl/Search/Xapian/TermIterator.html
This class also overloads eq, ne, ==, !=, and "" (stringification).
I'm guessing that stringification is working.
Thanks for any guidance.
Also I noticed that the docs refer to Search::Xapian:: but the examples
in the bindings directory use just Xapian::.
Why the change?
Jim.