Opened 18 years ago

Closed 13 years ago

Last modified 13 years ago

#158 closed defect (fixed)

Query::MatchAll and MatchNothing not wrapped for C# or Java

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

Description (last modified by Olly Betts)

The obvious patch for this (below) doesn't work - in Python, you get a property of xapian.Query() added, which means that you have to instantiate xapian.Query to get at MatchNothing (ie, xapian.Query().MatchNothing works, but xapian.Query.MatchNothing doesn't). It should be easy enough to fix this with a python specific workaround though.

PHP also doesn't work; I can't seem to access the resulting function at all, but this may be more due to my lack of PHP knowledge.

I've not tested for other languages yet.

Index: xapian.i
===================================================================
--- xapian.i    (revision 8676)
+++ xapian.i    (working copy)
@@ -871,6 +871,9 @@
 
        ~Query();
 
+       static Xapian::Query MatchAll;
+       static Xapian::Query MatchNothing;
+
        termcount get_length() const;
        TermIterator get_terms_begin() const;
        TermIterator get_terms_end() const;

Change History (13)

comment:1 by Richard Boulton, 17 years ago

Blocking: 120 added

Marking this for 1.0.x, since it ought to be fixed. It really ought to be simple to fix, but I'm not completely sure how to do so, or I'd have marked it for 1.0.1.

comment:2 by Olly Betts, 17 years ago

Operating System: All
Status: newassigned

comment:3 by Olly Betts, 17 years ago

Someone pointed out on IRC that we could wrap these by hand in the languages by making use of the Query() and Query("") forms. This certainly seems feasible for Python anyway.

comment:5 by Richard Boulton, 17 years ago

Description: modified (diff)
Milestone: 1.1

comment:6 by Richard Boulton, 17 years ago

Blocking: 120 removed

(In #120) Remove the unfixed dependencies so we can close this bug - they're all marked for the 1.1.0 milestone.

comment:7 by Olly Betts, 16 years ago

Description: modified (diff)
Milestone: 1.1.01.1.1

This wouldn't be an incompatible change, so bumping to 1.1.1.

comment:8 by Olly Betts, 16 years ago

Milestone: 1.1.11.1.3
Summary: Query::MatchNothing and Query::MatchAll aren't wrappedQuery::MatchAll and MatchNothing not wrapped for C#, PHP, Ruby

Wrapped for Python and Tcl8 in trunk r12758. For C#, PHP, and Ruby I documented how to use Query("") or Query() instead. I think for PHP at least, that's actually the cleanest possible way to wrap it.

Updating summary and setting milestone:1.1.3.

comment:9 by Olly Betts, 15 years ago

Milestone: 1.1.31.2.0

Bumping to 1.2.x - this has been fixed or documented for all languages.

comment:10 by Olly Betts, 13 years ago

Milestone: 1.2.x1.3.0
Summary: Query::MatchAll and MatchNothing not wrapped for C#, PHP, RubyQuery::MatchAll and MatchNothing not wrapped for C#, Java, Perl, PHP

Wrapped for Ruby in r15708.

For PHP, these can't be class constants AFAICS, so they'd have to be a static singleton methods - i.e. XapianQuery::MatchAll() and XapianQuery::MatchNothing(). Perhaps that's better than having to use new XapianQuery('') and new XapianQuery() - it's certainly better as self-describing code.

Also, need to sort this out for Java and Perl.

Target this at 1.3.0.

comment:11 by Olly Betts, 13 years ago

Summary: Query::MatchAll and MatchNothing not wrapped for C#, Java, Perl, PHPQuery::MatchAll and MatchNothing not wrapped for C#, Java, PHP

Perl done (by hand) in r15709.

comment:12 by Olly Betts, 13 years ago

Summary: Query::MatchAll and MatchNothing not wrapped for C#, Java, PHPQuery::MatchAll and MatchNothing not wrapped for C# or Java

PHP wrapped in trunk r15807 - in a brief discussion on IRC we concluded that XapianQuery::MatchAll() is a suitable way to wrap this.

comment:13 by Olly Betts, 13 years ago

Milestone: 1.3.01.2.7
Resolution: fixed
Status: assignedclosed

Wrapped for Java and C# in r15808, which means this is now done for all languages.

Marking for backporting to 1.2.7.

comment:14 by Olly Betts, 13 years ago

Just to clarify the status, I accidentally marked this as fixed when I updated the milestone, but these changes are now all backported, so it is now actually fixed in both trunk and 1.2 branch. It's not done for the XS Search::Xapian or the hand-coded JNI Java bindings, but I don't think it's worth the extra effort to do these now.

Note: See TracTickets for help on using tickets.