Hi, everybody.
I have a problem with HibernateSearch indexes creation, when i save a new entity through hibernate. Here is my class (simplified):
Code:
@Entity
@Indexed
public class Discussion {
@Id
@GeneratedValue
@DocumentId
private Long id;
@Column(columnDefinition = "varchar2(255)")
@NotEmpty(message = "#{messages['discussion.error.title.empty']}")
@Length(min = 1, max = 255, message = "#{messages['discussion.error.title.length']}")
@Field(index = Index.TOKENIZED)
private String title;
@Lob
@Column(columnDefinition = "CLOB")
private String description;
....
}
Here is how i save new entity:
Code:
@In
private Session currentSession; //declared in components.xml
...
//create and fill new discussion
...
currentSession.saveOrUpdate(newDiscussion);
currentSession.flush();
Here is my persistence.xml:
Code:
<persistence 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_1_0.xsd"
version="1.0">
<persistence-unit name="myDatabase">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/myDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider"/>
<property name="hibernate.search.default.indexBase" value="c:/my_indexes"/>
<property name="hibernate.ejb.event.post-insert" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/myEntityManagerFactory" />
</properties>
</persistence-unit>
</persistence>
As you can see from persistence.xml, i want to store my indexes in c:/my_indexes folder. When i deploy my app, this folder creates. But when i save new discussion, indexes doesn't appears in specified folder. Did i miss some configuration options? Please, tell me where i'm wrong.
P.S. I'm using Seam 2.0.1.ga, HS 3.0.0, HA 3.3.0, JBOSS 4.2.1.ga and Oracle 10g