lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lu" <chris...@gmail.com>
Subject Re: Analyzers
Date Thu, 08 Feb 2007 18:33:01 GMT
This is an example for PerFieldAnalyzerWrapper,

    public Analyzer getAnalyzer() throws ClassNotFoundException,
InstantiationException, IllegalAccessException{
        _analyzer = new PerFieldAnalyzerWrapper((Analyzer)
Class.forName(this.getAnalyzerName()).newInstance());
        ArrayList columns = this.getColumns();
        for(int i=0; i< columns.size(); i++) {
            Column c = (Column) columns.get(i);
            if(c.getAnalyzerName()!=null) {
                _analyzer.addAnalyzer(c.getColumnName(), (Analyzer)
Class.forName(c.getAnalyzerName()).newInstance());
            }
        }
        return (Analyzer) _analyzer;
    }

-- 
Chris Lu
-------------------------
Instant Full-Text Search On Any Database/Application
site: http://www.dbsight.net
demo: http://search.dbsight.com

On 2/8/07, Kainth, Sachin <Sachin.Kainth@atkinsglobal.com> wrote:
> Can you give me an example of how this might be done?
>
> -----Original Message-----
> From: Erick Erickson [mailto:erickerickson@gmail.com]
> Sent: 08 February 2007 17:34
> To: java-user@lucene.apache.org
> Subject: Re: Analyzers
>
> Use PerFieldAnalyzerWrapper.
>
> On 2/8/07, Kainth, Sachin <Sachin.Kainth@atkinsglobal.com> wrote:
> >
> > Hi all,
> >
> > I wanted to know if it is possible to store some fields in an index
> > with one analyzers and other fields with another analyzer?
> >
> > Cheers
> >
> > Sachin
> >
> >
> > This email and any attached files are confidential and copyright
> > protected. If you are not the addressee, any dissemination of this
> > communication is strictly prohibited. Unless otherwise expressly
> > agreed in writing, nothing stated in this communication shall be
> legally binding.
> >
> > The ultimate parent company of the Atkins Group is WS Atkins plc.
> > Registered in England No. 1885586.  Registered Office Woodcote Grove,
> > Ashley Road, Epsom, Surrey KT18 5BW.
> >
> > Consider the environment. Please don't print this e-mail unless you
> > really need to.
> >
>
>
> This message has been scanned for viruses by MailControl - (see
> http://bluepages.wsatkins.co.uk/?4318150)
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message