I think there is a development in the bug #616. The exception obtained is: Exception in thread "main" java.lang.IllegalArgumentException: No enum class org.xapian.TermGenerator$flags with value 0 at org.xapian.TermGenerator$flags.swigToEnum(TermGenerator.java:143) at org.xapian.TermGenerator.setFlags(TermGenerator.java:71) at org.xapian.examples.SimpleIndex.main(SimpleIndex.java:54) Error seems to occur in the swigToEnum method. So I checked http://www.swig.org/Doc2.0/SWIGDocumentation.html#Java_enum_classes We could expect a similar class to get built in our case except that 'flags' would have only one type in it ie.'FLAG_SPELLING'. And the rest of the values in the class would get set accordingly. Now when flags(0) is executed, the swigToEnum method will run with 0 as a parameter. And this method tries to return a type whose value matches the value of the passed parameter. So it is unable to find a type with value 0 (FLAG_SPELLING has value 128) and hence throws the exception. Thanks and Regards, Anish Kanchan Student, University of Mumbai On Tue, Feb 25, 2014 at 6:06 AM, Olly Betts <olly at survex.com> wrote:> On Tue, Feb 25, 2014 at 02:45:28AM +0530, Anish Kanchan wrote: > > Xapian is a search engine library written in C/C++. It can be > > integrated with web applications which handle large amount of data. > > But since the web applications may be written in a variety of languages a > > binding is required for the web app to be able to connect to the xapian > > software. And SWIG plays a role in generating intermediate code for the > web > > app to link with the bindings. > > > > I'd like to know if what I've understood is correct. > > Yes. > > Scripting languages generally provide a C API which allows you to write > a wrapper, but trying to maintain such wrappers by hand for a large API > is quite a lot of work. SWIG helps to automate that job by generating > wrapper code which uses the available C API for you. > > Often we can add a new method to the C++ API and need to do nothing > extra to have it available in the bindings. Sometimes it gets wrapped, > but we need to give SWIG some help to wrap it in the best way. > > You might find this talk I gave at Kiwi PyCon 2011 helpful - there > are slides and recorded audio there: > > http://survex.com/~olly/talks/pythonic-swig/ > > Cheers, > Olly >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20140227/b179a616/attachment-0002.html>
With the #616 bug now solved, I would like to solve more bugs. Could you please give me links of those. Also the as Xapian Java Bindings project is supposed to be too simple, I'm thinking of working on PHP Bindings improvement as well. Could you please guide me on how I can go about it? And what else could I do to strengthen my chances of getting selected in GSoC? Regards, Anish Kanchan Student, University of Mumbai On Thu, Feb 27, 2014 at 5:22 PM, Anish Kanchan <anishgkanchan at gmail.com>wrote:> I think there is a development in the bug #616. > > The exception obtained is: > > Exception in thread "main" java.lang.IllegalArgumentException: No enum > class org.xapian.TermGenerator$flags with value 0 > at org.xapian.TermGenerator$flags.swigToEnum(TermGenerator.java:143) > at org.xapian.TermGenerator.setFlags(TermGenerator.java:71) > at org.xapian.examples.SimpleIndex.main(SimpleIndex.java:54) > > Error seems to occur in the swigToEnum method. > So I checked > http://www.swig.org/Doc2.0/SWIGDocumentation.html#Java_enum_classes > We could expect a similar class to get built in our case except that > 'flags' would have only one type in it ie.'FLAG_SPELLING'. And the rest of > the values in the class would get set accordingly. > > Now when > > flags(0) is executed, the swigToEnum method will run with 0 as a > parameter. And this method tries to return a type whose value matches the > value of the passed parameter. > > So it is unable to find a type with value 0 (FLAG_SPELLING has value > 128) and hence throws the exception. > > > Thanks and Regards, > Anish Kanchan > Student, University of Mumbai > > > > On Tue, Feb 25, 2014 at 6:06 AM, Olly Betts <olly at survex.com> wrote: > >> On Tue, Feb 25, 2014 at 02:45:28AM +0530, Anish Kanchan wrote: >> > Xapian is a search engine library written in C/C++. It can be >> > integrated with web applications which handle large amount of data. >> > But since the web applications may be written in a variety of languages >> a >> > binding is required for the web app to be able to connect to the xapian >> > software. And SWIG plays a role in generating intermediate code for the >> web >> > app to link with the bindings. >> > >> > I'd like to know if what I've understood is correct. >> >> Yes. >> >> Scripting languages generally provide a C API which allows you to write >> a wrapper, but trying to maintain such wrappers by hand for a large API >> is quite a lot of work. SWIG helps to automate that job by generating >> wrapper code which uses the available C API for you. >> >> Often we can add a new method to the C++ API and need to do nothing >> extra to have it available in the bindings. Sometimes it gets wrapped, >> but we need to give SWIG some help to wrap it in the best way. >> >> You might find this talk I gave at Kiwi PyCon 2011 helpful - there >> are slides and recorded audio there: >> >> http://survex.com/~olly/talks/pythonic-swig/ >> >> Cheers, >> Olly >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20140228/ab41ad19/attachment-0002.html>
On Fri, Feb 28, 2014 at 07:18:50PM +0530, Anish Kanchan wrote:> With the #616 bug now solved, I would like to solve more bugs.Did you send a patch or pull request for those changes? I can't see either.> Could you please give me links of those.There's this (as linked from the project idea): http://trac.xapian.org/ticket/46 Looking at providing Java iterators would be useful (there's no ticket for this). Dan did some work towards this, and a few other things, which you can find here: https://github.com/dcolish/xapian/tree/java-fixes> Also the as Xapian Java Bindings project is supposed to be too simple, I'm > thinking of working on PHP Bindings improvement as well.I think this got answered on IRC, but yes there's not really enough to the Java bindings project alone, so you'd probably need to combine it with something else.> And what else could I do to strengthen my chances of getting selected in > GSoC?A few good quality patches are useful, as they give us an insight into what you skills are and how your work. The proposal is also important of course. There are some tips here: http://trac.xapian.org/wiki/GSoC%20Guide#Writingyourproposal The GSoC Student Guide has a lot of useful advice too: http://en.flossmanuals.net/GSoCStudentGuide/ Cheers, Olly