You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Claudia Santos <cl...@gmail.com> on 2008/11/24 14:19:06 UTC

GermanAnalyzer

Hello, 

I'm a newbie with Lucene and I started some testing with a small Web Application with Lucene 2.4.0 and Hibernate Search 3.0.0. The test with the Standard Analyser were successful, but when i try to use the German Analyser (for indexing and searching) i get the following error in localhost file from Tomcat 6.0: 

"SCHWERWIEGEND: Servlet.service() for servlet Faces Servlet threw exception 
java.lang.AbstractMethodError: org.apache.lucene.analysis.TokenStream.next()Lorg/apache/lucene/analysis/Token;" 


my code is: 

public List search(final int startRecord,final int endRecord, final String searchTerm) {

List searchResult = (List) getHibernateTemplate().execute( 

new HibernateCallback() {


public Object doInHibernate(org.hibernate.Session session) {

try {

FullTextSession fullTextSession = Search.createFullTextSession(session);

QueryParser parser = new MultiFieldQueryParser( FIELD_NAMES, new GermanAnalyzer());


org.apache.lucene.search.Query query;



// this is the line that generates the error     

query = parser.parse(searchTerm);



org.hibernate.search.FullTextQuery hibernateQuery = fullTextSession.createFullTextQuery(query, Book.class);


hibernateQuery.setFirstResult(startRecord);

hibernateQuery.setMaxResults(endRecord);

setNumberFeeds(hibernateQuery.getResultSize());

List results = hibernateQuery.list();


return results;


} catch (ParseException e) {

e.printStackTrace();

return null;

}


}


}, true);


return searchResult;


}



i found nothing in internet about the error message, any help is appreciated :) 
regards, 

Re: GermanAnalyzer

Posted by Claudia Santos <cl...@gmail.com>.
Hi,

Thanks a lot :)

I will try that.

csantos
----- Original Message ----- 
From: "Hardy Ferentschik" <lu...@ferentschik.de>
To: <ja...@lucene.apache.org>
Sent: Monday, November 24, 2008 2:42 PM
Subject: Re: GermanAnalyzer


> Hi,
>
> I think your question belongs more onto the Hibernate Search Forum - 
> http://forum.hibernate.org/viewforum.php?f=9.
>
> That said, it looks like a you have a version problem. Hibernate Search 
> 3.0.0 is based on Lucene
> Lucene 2.2. I recommend updating Hibernate Search to the latest 3.1.0 
> release. not only will you be able
> to use Lucene 2.4, but you can also use the AnalyzerDef framework to 
> define your German analyzer.
> Check the online documenation 
> (http://www.hibernate.org/hib_docs/search/reference/en/html_single) for 
> AnalyzerDef.
>
> If you still have problems after an upgrade I recommend posting to the 
> Search forum.
>
> --Hardy
>
>
> On Mon, 24 Nov 2008 14:19:06 +0100, Claudia Santos 
> <cl...@gmail.com> wrote:
>
>> Hello,
>>
>> I'm a newbie with Lucene and I started some testing with a small Web 
>> Application with Lucene 2.4.0 and Hibernate Search 3.0.0. The test with 
>> the Standard Analyser were successful, but when i try to use the German 
>> Analyser (for indexing and searching) i get the following error in 
>> localhost file from Tomcat 6.0:
>>
>> "SCHWERWIEGEND: Servlet.service() for servlet Faces Servlet threw 
>> exception
>> java.lang.AbstractMethodError: 
>> org.apache.lucene.analysis.TokenStream.next()Lorg/apache/lucene/analysis/Token;"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: GermanAnalyzer

Posted by Hardy Ferentschik <lu...@ferentschik.de>.
Hi,

I think your question belongs more onto the Hibernate Search Forum -  
http://forum.hibernate.org/viewforum.php?f=9.

That said, it looks like a you have a version problem. Hibernate Search  
3.0.0 is based on Lucene
Lucene 2.2. I recommend updating Hibernate Search to the latest 3.1.0  
release. not only will you be able
to use Lucene 2.4, but you can also use the AnalyzerDef framework to  
define your German analyzer.
Check the online documenation  
(http://www.hibernate.org/hib_docs/search/reference/en/html_single) for  
AnalyzerDef.

If you still have problems after an upgrade I recommend posting to the  
Search forum.

--Hardy


On Mon, 24 Nov 2008 14:19:06 +0100, Claudia Santos  
<cl...@gmail.com> wrote:

> Hello,
>
> I'm a newbie with Lucene and I started some testing with a small Web  
> Application with Lucene 2.4.0 and Hibernate Search 3.0.0. The test with  
> the Standard Analyser were successful, but when i try to use the German  
> Analyser (for indexing and searching) i get the following error in  
> localhost file from Tomcat 6.0:
>
> "SCHWERWIEGEND: Servlet.service() for servlet Faces Servlet threw  
> exception
> java.lang.AbstractMethodError:  
> org.apache.lucene.analysis.TokenStream.next()Lorg/apache/lucene/analysis/Token;"

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org