Thanks for taking the time to converse with me about this.
sanne.grinovero wrote:
I guess that if this one implementation requires some "extra" specific initialization you could open an IndexWriter in the initialize or start methods, then commit and close it.
I think that's what I need to do. I found a bug in my DirectoryProvider - I was always calling Directory.create(), which was dropping the tables and recreating them. Not good.
Now I check if the tables exist and only create them if necessary. However, ONLY the tables get created, the index "files" do not, which leads to the "segments* not found" error. I read of a similar problem elsewhere - that an API change in Lucene 3.1 necessitates the steps you mention.
What I don't know, though, is how to configure the IndexWriter. I just figured out I need to use one late last night.
Quote:
Two things to be careful about:
- Make sure you close the IndexWriter or the index will stay locked and HS won't be able to use it (obviously it doesn't expect a locked index)
- Make sure you're not resetting an existing index ("reset" as in "wipe out" : verify it won't delete all content from an existing index)
Will do.
Quote:
Let me understand your case better: you want to store the index in an RDBMS but don't need clustering, right?
I guess so as otherwise you would have looked at Infinispan first, at least for clustered caching of entities.
We are doing simplistic clustering. We use database replication to keep two synced copies of our database (including the Lucene index). Web clients are bounced between the two servers. Index updates only happen on one server via a cron job. Using Infinispan is probably the "right" long-term solution. However, I'm trying to change things slowly - starting with swapping out Compass for Hibernate Search but leaving everything else as untouched as possible. Moving to Hibernate Search gets us a newer version of Lucene, new index mapping syntax, and based on some tests, speeds things up a bit.
- Jasen.