I m trying to integrate hibernate search in my existing application. According to the tutorial of hibernate search i 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 i have added the annotation on the entity classes for which i want to enable search. Using @Indexed on class and @Field on the fields.
Following are the versions i am 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 this sample code to perform a 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 I get this error : The type org.hibernate.classic.Session cannot be resolved. It is indirectly referenced from required .class files
at : searchSession.createFullTextQuery(query, Book.class);
What can be the problem ??