spring - java - hibernate search indexing not working -


i m trying integrate hibernate search in existing application. according tutorial of hibernate search have added following properties in hibernate properties in applicationcontext.xml

<prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.fsdirectoryprovider</prop>   <prop key="hibernate.search.default.indexbase">./lucene/indexes</prop>  

also have added annotation on entity classes want enable search. using @indexed on class , @field on fields.

following versions using (i'm not using maven):

  • hibernate-search - 3.2.0.final
  • hibernate-commons-annotations 4.0.1.final
  • hibernate-core - 4.1.11 final
  • hibernate-entitymanager - 3.4.0.ga
  • spring - 3.2.2 realease
  • lucene-core - 3.2.0

and i'm using sample code perform search in mysql database :

public void search() {  fulltextsession searchsession = search.getfulltextsession(sessionfactory.getcurrentsession());  queryparser parser = new queryparser(version.lucene_32, "contenu", new standardanalyzer(version.lucene_32));  org.apache.lucene.search.query query = parser.parse("décarbonateront");  org.hibernate.query hibquery = searchsession.createfulltextquery(query, book.class);  list result = hibquery.list();  system.out.println("lucene results: " + result.size());  } 

but error : the type org.hibernate.classic.session cannot resolved. indirectly referenced required .class files

at : searchsession.createfulltextquery(query, book.class);

what can problem ??

you need align hibernate , hibernate search versions. need hibernate 3.5.x hibernate search 3.2. check versions example in maven pom - https://repository.jboss.org/nexus/content/repositories/public/org/hibernate/hibernate-search-parent/3.2.0.final/hibernate-search-parent-3.2.0.final.pom.

you download hibernate search distribution sourceforge. distribution contains right dependencies well.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -