Connecting to Java

Alex Tweedly alex at tweedly.net
Sun Jan 22 18:17:55 EST 2006


Eric Chatonet wrote:

> To be more precise, I want to use Lucene (http://lucene.apache.org/)  
> with a Rev desktop app that will provide the GUI.
> Not the main point but FYI, the software will use also a SQL database.
> Is that a bit more clear???
> :-)
>
Java is notoriously difficult to interface with.

You might be able to create an External using the same technique as 
PyLucene did (i.e. compiling Lucene using the GCJ compiler, and then 
linking to the C++ style interface provided in the PyLucene binaries). 
Tough - but practical if you can handle C or C++

Or, you could use sockets to communicate with the desktop app, and write 
some Java app to get from sockets to the Lucene interface. Probably 
reasonable if you already know Java, and impractical if you don't :-)

Or you could use sockets to communicate from the Rev desktop app, to a 
Python app using PyLucene to do the indexing and searching. Not easy, 
but probably significantly easier than either of the above. (And if you 
already know Python, then an order of magnitude easier again). 

The success of that approach would depend on the kind of app - but 
compared to a text search (or indexing), the socket overhead and delay 
would likely be small. It would also depend somewhat on how broad a 
subset of the possible Lucene interface/ feature set you need to use.

You might be able to use (abuse?) Nutch run on a local web server to do 
what you need, with your Rev app using http requests to the localhost 
..... a long shot, but might work for some uses.

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date: 20/01/2006




More information about the use-livecode mailing list