Jim
2021-Sep-11 20:41 UTC
Xapian::Termiterator is not working the way it used to with perl
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.
Jim
2021-Sep-12 19:29 UTC
Xapian::Termiterator is not working the way it used to with perl
I discovered the answer to this.? Search::Xapian is the XS bindings while Xapian is the the SWIG generated bindings.? Since I couldn't figure out how to get DateRangeProcessor or NumberRangeProcessor to work, and I found an example that used the SWIG bindings, I switched.? That may account for the change in behavior of the Termiterator.? Is there documentation for the SWIG bindings? Thanks Jim On 9/11/21 4:41 PM, Jim wrote:> Also I noticed that the docs refer to Search::Xapian:: but the > examples in the bindings directory use just Xapian::. > > Why the change?