I have an app that I'm attempting to integrate hibernate search into. I'm using Hibernate Search 3.4.2. I have a domain class that looks like the following:
@Indexed public Group { @Fieldindex (index = Index.TOKENIZED, store = Store.YES) private String groupName; }
In my test cases, I create a few Groups and save them to the database. Once stored in the database, I create the index and then search for given text strings. This seems to work.
The problem I'm having is that any new Groups created after the index has been created are not indexed. From what I've read, I thought that once the index is created, any new items persisted would be automatically indexed with the new values, but this doesn't seem to be the behavior I'm getting. Is there something I've missed in the way of configuration? Or do I have to do something manually to tell Hibernate Search that I've added a new object to be indexed?
Needless to say, I'm a bit confused...
[EDIT] I'm using JPA, so my hibernate search confguration is contained in my persistence.xml as follows:
<property name="hibernate.search.default.directory_provider" value="filesystem"/> <property name="hibernate.search.default.indexBase" value="D:\var2\lucene\indexes"/>
I can see that the index files are created, and I can use Luke to view the contents, they just don't ever seem to get updated when I persist a new object.