Skip to content

Custom Configuration #15

wavyx opened this Issue Mar 25, 2013 · 3 comments

2 participants

wavyx commented Mar 25, 2013


I was wondering if there is specific configuration keys to tweak the Lucene IndexWriter or change the Hibernate Search settings.

For eg, I would like to increase for WRITE_LOCK_TIMEOUT ( or set the indexing strategy ( to manual.

Is there a full list of config keys supported by hibernate-search plugin. So far I have:

  • search.default.directory_provider = 'filesystem'
  • search.default.indexBase = '/path/to/your/indexes'
  • search.default.indexBaseJndiName = 'java:comp/env/luceneIndexBase'

Thanks for your help

mathpere commented Apr 3, 2013

Hello, sorry to be late!

There is currently no way to tweak Lucene config.
But I checked the code and this could be very easy. You want to tune these kind of settings:[default|<indexname>].indexwriter.[batch|transaction].[...] = [...]

I don't have enough time currently but it can be handled into the class SearchMappingConfigurableLocalSessionFactoryBean within the method postProcessConfiguration exactly where the other settings you mention are set.

wavyx commented Apr 3, 2013

I tried, but was not able to properly setWriteLockTimeout() because you use
private final IndexWriterConfig writerConfig = new IndexWriterConfig( Version.LUCENE_31, SIMPLE_ANALYZER );
private final IndexWriterConfig batchWriterConfig = new IndexWriterConfig( Version.LUCENE_31, SIMPLE_ANALYZER );

And I was not able to provide a custom Workspace through spring beans.

So I cheated and added "IndexWriterConfig.WRITE_LOCK_TIMEOUT = 20000" in my resources.groovy to make sure this static default value is initialized before the spring wiring

I'm open to better solution, but this workaround seems to work.

mathpere commented Apr 4, 2013

The plugin should handle more settings, this would be a more elegant solution :)

private final IndexWriterConfig writerConfig = new IndexWriterConfig( Version.LUCENE_31, SIMPLE_ANALYZER ); is not my doing but from the underlying libraries (Hibernate Search or Lucene).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.