Opened 9 years ago

Last modified 3 months ago

#523 new defect

Migrate from XS Search::Xapian to SWIG version

Reported by: olly Owned by: olly
Priority: normal Milestone: 1.4.6
Component: Search::Xapian Version: git master
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description (last modified by olly)

This ticket is to track the issues remaining to solve before the SWIG Perl bindings are a complete replacement for the XS ones.

  • "$it" doesn't work in SWIG, while in XS it dereferences (for TermIterator and ValueIterator at least). I did some digging last year and it seemed there was some problematic interaction with eq/ne which I didn't get to the bottom of.
  • "Stringify" is also missing for subclasses of Error (which in the XS version I'm using in 1.2.4 to give backwards compatibility for cases which were still throwing string exceptions in 1.2.3).
  • XS version has simple anon-sub wrappers for MatchDecider and ExpandDecider. SWIG doesn't support directors for Perl in current releases (though there's work on a branch). But perhaps we can support these simple wrappers without needing directors.
  • The SWIG-generated version is fussier about what sort of scalars you pass - for example, if an integer is expected, passing a string containing an integer or floating point number doesn't work, at least in some cases.

One option is to deprecate the stringify stuff and make the switch at the start of the next release series.

Change History (13)

comment:1 Changed 8 years ago by olly

  • Milestone changed from 1.2.x to 1.3.0

Doing this for the next release series seems to make most sense. Now we've made a release branch for 1.2.x, I've removed the XS Search::Xapian from trunk.

comment:2 Changed 8 years ago by olly

It would be nice to wrap iterators in a more natural way for Perl - this article gives a good approach which would probably work:

http://www.perl.com/pub/2005/06/16/iterators.html

comment:3 Changed 8 years ago by olly

  • Description modified (diff)

comment:4 Changed 8 years ago by olly

  • Milestone changed from 1.3.0 to 1.3.x

Backported r16227

comment:5 Changed 4 years ago by olly

  • Milestone changed from 1.3.x to 1.3.5

comment:6 Changed 4 years ago by olly

  • Milestone changed from 1.3.5 to 1.3.x
  • Version changed from SVN trunk to git master

I talked through these issues at a Wellington PM meeting a while ago and have notes from that, but I think this is going to take a while to work through properly.

I'm pondering if we should release 1.4.0 with the Perl bindings clearly labelled as "still experimental", and then resolve this in early 1.4.x.

Moving to 1.3.x for now.

comment:7 Changed 3 years ago by olly

SWIG now supports directors for Perl, though taking a code ref (which would typically be an anonymous subroutine) would be a nicer Perl API for the simple functors.

comment:8 Changed 3 years ago by olly

  • Milestone changed from 1.3.x to 1.4.1

Postpone until 1.4.1

comment:9 Changed 3 years ago by olly

  • Milestone changed from 1.4.1 to 1.4.3

Search::Xapian 1.2.24.0 will be compatible with xapian-core 1.4.x so this is a little less urgent.

comment:10 Changed 3 years ago by olly

  • Milestone changed from 1.4.3 to 1.4.4

Ticket retargeted after milestone closed

comment:11 Changed 2 years ago by olly

  • Milestone changed from 1.4.4 to 1.4.5

Ticket retargeted after milestone closed

comment:12 Changed 2 years ago by olly

  • Milestone changed from 1.4.5 to 1.4.6

Ticket retargeted after milestone closed

comment:13 Changed 3 months ago by e.80x24.org

Xapian::PostingIterator? lacks "->inc" sub from Search::Xapian::PostingIterator?; so I need to rely on "++" which I find confusing (overloading confuses me :x)

Also, I could not find Xapian::ENQ_ASCENDING, since I rely on Search::Xapian::ENQ_ASCENDING.

Note: See TracTickets for help on using tickets.