lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Integrating Lucene with hibernate3
Date Sat, 10 Dec 2005 08:27:05 GMT
: following the interceptor method (the second one in

I don't know much about hibernate, but I think i understand both of your

: 1. Lucene's doesn't create the needed folder structure the first time
: and it complains that it can't find segments.
: /Applications/OpenLaszlo Server
: 3.1/Server/tomcat-5.0.24/webapps/com.estudiowebs.CMS/WEB-INF/luceneIndex/segments
: (No such file or directory)

If you look at the javadocs for IndexWriter, you'll note that the last
argument in the constructor indicates wether or not you want the
IndexWriter to make a new index, or open an existing index.  In the
URL you cited, the arg is allways false -- so unless you've got
seperate code in your application that uses an IndexWriter to create the
index, It's not suprising that the code in the article would generate an
error like that.

: 2. My database uses native ids which means that in the interceptor
: onSave() method the id is null and it throws an exception.

if you copied the onSave method exactly as it appears, then i'm not sure
how a null id could ever cause it to throw an exception ("null
instanceof Long" will be false, and the method should do nothing) but if
you read the comments at the bottom on the page, you'll see suggestions to
use something called a "PostInsertEventListener" instead.

...a side commentary on this article -- the hibernate side of things may
make perfect sense to someone who understands hibernate really well, but
as someone who (I like to think) understands the basics of Lucene very
well, I think it's very lacking in it's explanation of Lucene concepts and
API usage.  I would not send this URL to anyone as an example of
integrating Hibernate and Lucene unless I felt they already understood
Lucene thoroughly.  You may want to start by learning more about Lucene
independent of hibernate, reading though the demo application for example,
before trying to bridge the two...


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message