Hello, Andi. got it. It works excellent :) Big Thanks!
AV> There were several bugs here that I now fixed. One issue has to do with AV> method overloads and python. In python you can have only one method called AV> 'search' on a class. There are three on Java Lucene's Searchable interface. AV> So, I renamed the python search methods one needs to define on a python AV> searchable implementation as follows: AV> void search(jquery, jfilter, jhitcollector); AV> becomes AV> def searchAll(self, query, filter, hitCollector): AV> TopDocs *search(jquery, jfilter, jint); AV> becomes (no rename) AV> def search(self, query, filter, n): AV> TopFieldDocs *search(jquery, jfilter, jint, Sort *); AV> becomes AV> def searchSorted(self, query, filter, n, sort): AV> I attached a new version of your RemoteSearcher.py file for reference. AV> The latest fixes are checked in. AV> Andi.. AV> On Fri, 14 Jan 2005, Yura Smolsky wrote: >> Hello, Andi. >> >> I have tried to implement Searchable interface and pass it to the >> MultiSearcher instance, but it produces exception from java. >> >> d:\work\python24\python.exe RemoteSearcher.py >> Traceback (most recent call last): >> File "RemoteSearcher.py", line 42, in ? >> parallel = MultiSearcher([remoteS]) >> File "d:\work\python24\lib\site-packages\PyLucene.py", line 1418, in >> __init__ >> newobj = _PyLucene.new_MultiSearcher(*args) >> ValueError: java.lang.NullPointerException >> at 0x1013720e (Unknown Source) >> at 0x10137702 (Unknown Source) >> at 0x101377b3 (Unknown Source) >> at 0x10136f6d (Unknown Source) >> at 0x1011d34d (Unknown Source) >> at 0x1017680d (Unknown Source) >> at 0x101186f2 (Unknown Source) >> at 0x10066df9 (Unknown Source) >> at 0x100f8d24 (Unknown Source) >> >> >> What am I doing wrong? >> >>>> Andi, is there a way to port interface Searchable, so I will implement >>>> this interface on python? >> >> AV> I just added support for Searchable, with the ability to extend it from >> AV> python. This is only minorly useful since the only place a Searchable is >> taken >> AV> as input by Lucene/PyLucene is when constructing a MultiSearcher. >> >> AV> Still, I added support for the methods defined on Searchable and >> inherited by >> AV> its various java implementations that were until now missing. >> >> AV> This is only available from the PyLucene subversion source repository. >> >> AV> When 'extending' a java lucene class or 'implementing' a java lucene >> AV> interface, you're not really extending or implementing anything as far as >> AV> java is concerned. All PyLucene is setup to do is take a custom python >> AV> implementation of a java lucene protocol (just a set of methods) and >> wrap them >> AV> in a java extension of the class or implementation of the interface in >> AV> question whose job is to call into this python implementation's method. >> For >> AV> this to work, such a java-calling-into-python wrapper class has to first >> be >> AV> defined in PyLucene and PyLucene.i has to also be setup to recognize the >> AV> python protocol implementations passed in to wrap them. >> >> AV> Currently, in PyLucene, there are a number such wrapper classes setup. >> Which >> AV> ones were setup is based on what I could see would be useful, or >> required in >> AV> terms of abstract lucene classes needing implementations to be usable. >> >> AV> Such 'reverse swigging' is a bunch of handcrafted boilerplate code as >> you can >> AV> see for yourself in the cpp and java directories of the PyLucene source >> tree. >> >> AV> I doubt that just extending PyLucene's export of Searchable is going to >> give >> AV> you a RemoteSearchable. It is not that simple, in particular, I did do >> AV> anything about the serializability of any of swig wrappers around the >> Lucene >> AV> objects as passed to python. >> >> AV> Andi.. >> >> >> Yura Smolsky, Yura Smolsky, _______________________________________________ pylucene-dev mailing list [EMAIL PROTECTED] http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
