Hibernate Lucene Integration
From Foochal
- Add the @Indexed(index="indexes/essays") annotation on persistent class
- Add the @Keyword(id=true) on the primary key field
- Add the following snipped to hibernate.cfg.xml
- <session-factory>
- <!-- lucene integration -->
- <!-- lucene file indexing -->
- <property name="hibernate.lucene.default.directory_provider">org.hibernate.lucene.store.FSDirectoryProvider</property>
- <property name="hibernate.lucene.indexBase">c:\\lucene-indexes\\</property>
- <event type="post-commit-update">
- <listener class="org.hibernate.lucene.event.LuceneEventListener" />
- </event>
- <event type="post-commit-insert">
- <listener class="org.hibernate.lucene.event.LuceneEventListener" />
- </event>
- <event type="post-commit-delete">
- <listener class="org.hibernate.lucene.event.LuceneEventListener" />
- </event>
- </session-factory>
Reference: http://www.hibernate.org/hib_docs/annotations/reference/en/html/lucene.html

