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 <[EMAIL PROTECTED]> wrote:
Can you give me an example of how this might be done?

-----Original Message-----
From: Erick Erickson [mailto:[EMAIL PROTECTED]
Sent: 08 February 2007 17:34
To: java-user@lucene.apache.org
Subject: Re: Analyzers

Use PerFieldAnalyzerWrapper.

On 2/8/07, Kainth, Sachin <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to