This is probably more useful to the general list. Thanks for the update, Dave — was this based on the previous golang bindings? J> Begin forwarded message: > > From: Dave Courtois <dave.courtois60 at gmail.com <mailto:dave.courtois60 at gmail.com>> > Subject: GoXapian > Date: 27 October 2018 at 15:27:09 BST > > Hi there just a little word to tell you that Xapian 1.4.6 work in Golang 1.9. There is some issue with the MSet ESet, the namespace part of the name is drop by swig. There is also some error with define macro in .i files, but with minor change all work perfectly. I made use of it as a search engine (and db), for my Javascript framework named CargoWebserver. Here is the link to the golang port, https://github.com/CargoWebServer/CargoWebServer/tree/master/Project/src/code.myceliUs.com/GoXapian <https://github.com/CargoWebServer/CargoWebServer/tree/master/Project/src/code.myceliUs.com/GoXapian>. I can wrote some unit test as you want, do you have some already written for Java or C++... > > Thx!-)-- James Aylett devfort.com <http://devfort.com/> — spacelog.org <http://spacelog.org/> — tartarus.org/james/ <http://tartarus.org/james/>
Dave Courtois wrote:> Hi there just a little word to tell you that Xapian 1.4.6 work in > Golang 1.9. There is some issue with the MSet ESet, the namespace part > of the name is drop by swig. There is also some error with define > macro in .i files, but with minor change all work perfectly. I made > use of it as a search engine (and db), for my Javascript framework > named CargoWebserver. Here is the link to the golang port, > https://github.com/CargoWebServer/CargoWebServer/tree/master/Project/src/code.myceliUs.com/GoXapian > <https://github.com/CargoWebServer/CargoWebServer/tree/master/Project/src/code.myceliUs.com/GoXapian>.Good stuff.> I can wrote some unit test as you want, do you have some already > written for Java or C++...There are a lot of unit tests for the C++ bindings (in xapian-core/tests/ in the source tree), but for the bindings which use SWIG to automate the wrapping we haven't generally tried to reproduce the same level of detailed coverage because if SWIG successfully wraps one method it's likely to also successfully wrap other methods which use the same types. Instead we have some tests that basic functionality works and we also try to make sure that any custom SWIG typemaps have test coverage. Then we add regression tests for any bugs fixed. This approach seems to have worked out well. There are Java bindings tests (xapian-bindings/java/SmokeTest.java) but I'd probably suggest looking at a couple of other languages' tests so you don't end up getting sidetracked by any Java-specific quirks. Cheers, Olly
On Mon, Nov 05, 2018 at 09:04:23PM +0000, Olly Betts wrote:> Dave Courtois wrote: > > Hi there just a little word to tell you that Xapian 1.4.6 work in > > Golang 1.9. There is some issue with the MSet ESet, the namespace part > > of the name is drop by swig. There is also some error with define > > macro in .i files, but with minor change all work perfectly.I had a look and I think that at least the macro changes are only needed because the golang branch hasn't been updated for ages. SWIG has a "%nspace" feature to support wrapping namespaces, but it isn't implemented for Go yet. However, Xapian's C++ API doesn't make much use of namespaces beyond the top-level Xapian namespace, and I'd expect in Go that the Go package name would fulfil the same purpose as the C++ namespace name - i.e. C++ Xapian::MSet -> Go xapian.MSet and so on. I've merged the current RELEASE/1.4 branch into the golang branch and pushed it (really it'd be better to work against git master as that's where this would need to be merged first, but it's probably easier for you to test in your setup working from RELEASE/1.4 branch). Cheers, Olly