-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: trouble with Hibernate Search indexes
PostPosted: Fri Feb 15, 2008 12:34 pm 
Newbie

Joined: Tue Feb 12, 2008 3:51 am
Posts: 6
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 17, 2008 4:00 pm 
Newbie

Joined: Tue Feb 12, 2008 3:51 am
Posts: 6
Hey, anybody, help me, please.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 20, 2008 4:28 am 
Pro
Pro

Joined: Wed Oct 03, 2007 2:31 pm
Posts: 205
Not sure if this will make a difference but do you have that directory created on your C drive? Try creating it. The properties look ok to me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.