0 Replies Latest reply on Sep 4, 2007 1:26 PM by srpantano

    Hibernate Search

    srpantano

      Where is the error in the code? Because doesn´t work. I´m using JPA + Seam 2.0.



      List result = null;
      
       try {
      
       org.apache.lucene.queryParser.QueryParser parser =
       new org.apache.lucene.queryParser.QueryParser("sistem",
       new org.apache.lucene.analysis.standard.StandardAnalyzer(BrazilianAnalyzer.BRAZILIAN_STOP_WORDS));
      
       org.apache.lucene.search.Query query = parser.parse("sistema");
       org.hibernate.search.FullTextQuery hibQuery =
       getFullTextSession().createFullTextQuery(query, Sistem.class);
      
       result = hibQuery.list();
      
       return result;
      
       } catch (ParseException ex) {
       Logger.getLogger("global").log(Level.SEVERE, null, ex);
       }
      


      but when I run:

      14:15:54,671 FATAL [application] java.lang.reflect.InvocationTargetException
      javax.faces.el.EvaluationException: java.lang.reflect.InvocationTargetException
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
       at javax.faces.component.UICommand.broadcast(UICommand.java:383)
      
      ...
      
      
      Caused by: java.lang.NoSuchMethodError: org.hibernate.search.FullTextSession.createFullTextQuery(Lorg/apache/lucene/search/Query;[Ljava/lang/Class;)Lorg/hibernate/search/FullTextQuery;
       at com.bcsinfo.security.view.web.util.FullTextSearch.search(FullTextSearch.java:77)
       at com.bcsinfo.security.view.web.util.FullTextSearch.toSearch(FullTextSearch.java:125)
       ... 87 more
      


      thanks for help!