-->
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: Problem Regarding snowball Analyser
PostPosted: Wed Oct 29, 2008 6:25 am 
Beginner
Beginner

Joined: Thu Sep 11, 2008 5:33 am
Posts: 28
Hi All,

As per Docs as mentioned example says we can use analyser for related words search. i.e. java rocks can be searched as rock, rocks etc.

EnglistAnalyser class
Code:
public class EnglishAnalyzer extends Analyzer {
   private static Logger log = Logger.getLogger(EnglishAnalyzer.class);
    /**
     * {@inheritDoc}
     */
    @Override
    public TokenStream tokenStream(String fieldName, Reader reader) {
        TokenStream result = new StandardTokenizer(reader);
        result = new StandardFilter(result);
        result = new LowerCaseFilter(result);
        result = new SnowballFilter(result, name);
        return result;
    }
}
 



Search query

Code:
org.apache.lucene.queryParser.QueryParser parser = new QueryParser("message", new EnglishAnalyzer() );


It gives error at

Code:
result = new SnowballFilter(result, name); //at name not found in EnglishAnalyser


i belive that name represents which Stemmer it should use? is what i am doing correct? trying this because of...

http://forum.hibernate.org/viewtopic.ph ... 07#2398507

but got stuck :( , any idea GUYS?

Regards,
Sachin Parnami


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 6:47 am 
Beginner
Beginner

Joined: Thu Sep 11, 2008 5:33 am
Posts: 28
have tried passing "English" as string in lieu of name


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2008 8:20 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

yes, "English" is the right string to use. "name" is a typo in the documentation.

Which version of Hibernate Search are you using? The online documentation is for 3.0.1.GA. Things have moved since then and there is now a 'nicer' way to define language stemmers leveraging from Solr's analyzer framework and using @AnalyzerDef. If you download the Hibernate Search distribution from SourceForge you will find the latest documentation within.

Of course the proposed way of doing things in 3.0.1.GA is still valid. Let me know if you have any problems with either approach.

--Hardy


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.