Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#431 closed enhancement (fixed)

valuestream, doclength bounds and wdf bounds not wrapped

Reported by: Richard Boulton Owned by: Richard Boulton
Priority: normal Milestone: 1.1.4
Component: Xapian-bindings Version: SVN trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

The following methods don't seem to be wrapped in the SWIG generated bindings currently:

       Xapian::termcount get_doclength_lower_bound() const;
       Xapian::termcount get_doclength_upper_bound() const;
       Xapian::termcount get_wdf_upper_bound(const std::string & term) const;
       ValueIterator valuestream_begin(Xapian::valueno slot) const;
       ValueIteratorEnd_ valuestream_end(Xapian::valueno) const;

The valuestream ones should also be wrapped as a convenient pythonic iterator when added (and the raw valuestream_* methods not added to the python API, so we don't have to deprecate them again in future.).

Attachments (1)

valuestream_pythonic_iterators.patch (7.2 KB ) - added by Richard Boulton 15 years ago.
Proposed implementation

Download all attachments as: .zip

Change History (4)

by Richard Boulton, 15 years ago

Proposed implementation

comment:1 by Richard Boulton, 15 years ago

I had this patch lying around on my tree, so thought I'd attach it here to stop it getting lost.

This is a complete, and fully tested, implementation as far as python is concerned. It compiles for the other bindings, but doesn't have any special support.

I think support is needed for Ruby (in xapian.rb) - at the least, the get_docid method needs to be wrapped for stream value iterators: it would be nice to support skip_to() on that wrapper, too. I'm not sure my ruby is up to the task of making a tested patch for that, though.

I don't think that special support is required for PHP, or the other languages - they just expose the C++ iterators, as far as I know.

comment:2 by Richard Boulton, 15 years ago

Milestone: 1.2.x1.1.4
Resolution: fixed
Status: newclosed

I learnt enough Ruby today to write a patch and a test for this. I'm pretty confident it's correct, and it doesn't add any controversial new API - just wraps recent additions to the C++ API. Therefore, rather than let this patch bitrot, I've applied it to trunk.

Adjusting milestones accordingly, and marking as fixed.

comment:3 by Olly Betts, 15 years ago

For reference, this was fixed by r13935.

Note: See TracTickets for help on using tickets.