Hello,
I recently migrated from Hibernate Search 3.6 to Hibernate Hibernate 4.0.0 and Hibernate core 4.0. Since this migration, indexing is no longer done automatically (folders aren't created, even when an object is saved).
My pom.xml (only changes)
Code:
...
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>4.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.0.Final</version>
</dependency>
...
My persistence.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation= "http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="DataCrawlerDS"
transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/TestPoolGlassfish</jta-data-source>
<class>fr.inf21project.entity.CrawledDocument</class>
<properties>
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.search.default.directory_provider"
value="filesystem" />
<property name="hibernate.search.default.indexBase" value="../demo_tika_lucene/indexes" />
</properties>
</persistence-unit>
</persistence>
I use JPA interfaces (EntityManager), not hibernate session.
Thanks you :)