lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Integrating Lucene with hibernate3
Date Sat, 10 Dec 2005 08:27:05 GMT
: following the interceptor method (the second one in
: http://www.hibernate.org/138.html)

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

: 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...

	http://lucene.apache.org/java/docs/gettingstarted.html


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message