What is the best way to use Lucene from a Cocoa app?

I am interested in working with Lucene from a Cocoa application. I know there are many ways to do this, but my question is, "Which way is better?" My research so far:

LuceneKit is the Objective-C port of Lucene, but it is based on the Lucene version, which is currently ancient, and trying to use it, I ran into several serious problems. (Inappropriate subclass of NSDate; a base query that works in Luke does not work with LuceneKit;) It does not seem to be a starter.

CLucene looked like it could be viable, but it fails in its own build tests, including the intermittent concurrency issue, where in half the cases I run the tests that they slowed down. Not inspiring. This may still be the answer, but I'm very nervous, given that my experience only builds it and runs its own tests.

The current Apache Lucene via JNI - just not naming the Java library from C, I'm not sure what is going on here. Of course, I feel that the official Apache-based incarnation of Lucene will probably be the most mature and functional, but it hasn’t done C ↔ Java JNI before, I don’t understand how it will be connected with working with CLucene.

There may be other options. I'm not necessarily looking for a first-class Objective-C interface (although I wouldn’t give it up as well), it’s just something functional and, I hope, reasonably mature and reasonably working. Does anyone have any sage advice?

+4
source share
1 answer

From my experience using JNI (though not with Lucene), it is not too difficult to do something simple, but you can write a lot of pretty monotonous code by doing everything.

Another option you can consider is JCC , which is used by the PyLucene project to create a C ++ template that wraps the JNI itnerface, which are then used to wrap the Python API.

+2
source

Source: https://habr.com/ru/post/1343492/


All Articles