Opened 9 years ago

Closed 9 years ago

#669 closed defect (fixed)

perl binding for set_collapse_key incomplete

Reported by: Felix Ostmann Owned by: Olly Betts
Priority: normal Milestone: 1.2.21
Component: Search::Xapian Version: 1.2.20
Severity: normal Keywords: set_collapse_key, perl, bug
Cc: Blocked By:
Blocking: Operating System: All

Description

The bindings for perl only accept the call to set_collapse_key() with one parameter (VALUE_NO).

The call with a second parameter COUNT is not working.

Caught exception in ... Usage: Search::Xapian::Enquire::set_collapse_key(THIS, collapse_key) at ...

We need this feature to collapse by source with more than 1 result. Idea from http://xapian.org/docs/collapsing.html

Attachments (1)

Search-Xapian-1.2.20.0.patch (1.5 KB ) - added by Felix Ostmann 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Felix Ostmann, 9 years ago

i simple copied the set_query/set_query1/set_query2 from Search/Enquire.pm AND XS/Enquire.xs and changed len to count and termcount len to int count and it is working (with 1.2.12 core and 1.2.20 perl-binding).

comment:2 by Olly Betts, 9 years ago

Severity: majornormal

Could you attach a patch of the changes you made?

comment:3 by Felix Ostmann, 9 years ago

first i tried to patch via github, but i dont understand the system behind the xs-generating.

so here is my patch without a test :-/

by Felix Ostmann, 9 years ago

comment:4 by Olly Betts, 9 years ago

Milestone: 1.2.21
Status: newassigned

This is already implemented in the SWIG-based Perl bindings on master - I've added a testcase to confirm this in [a44c59df66da187e4a9f24011e07766dfb9bb483].

Marking for 1.2.21 - backport new testcase and apply patch.

comment:5 by Olly Betts, 9 years ago

Resolution: fixed
Status: assignedclosed

Fixed in 1.2 branch by [4e1c85fff4db1651bf36f4e34c85d2034049ff5f].

Thanks very much for the patch, but I went for the simpler approach of just specifying the optional parameter in Enquire.xs directly.

Note: See TracTickets for help on using tickets.