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 "Kainth, Sachin" <Sa...@atkinsglobal.com> on 2007/02/08 18:24:55 UTC

Analyzers

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. 

RE: Analyzers

Posted by "Kainth, Sachin" <Sa...@atkinsglobal.com>.
Can you provide an example? 

-----Original Message-----
From: Chris Lu [mailto:chris.lu@gmail.com] 
Sent: 08 February 2007 17:35
To: java-user@lucene.apache.org
Subject: Re: Analyzers

This is totally possible.

--
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 <Sa...@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.
>

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



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


Re: Analyzers

Posted by Chris Lu <ch...@gmail.com>.
This is totally possible.

-- 
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 <Sa...@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.
>

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


Re: Analyzers

Posted by karl wettin <ka...@gmail.com>.
8 feb 2007 kl. 18.36 skrev Kainth, Sachin:

> Can you give me an example of how this might be done?

The javadocs is generally a good place to start:

http://lucene.apache.org/java/docs/api/org/apache/lucene/analysis/ 
PerFieldAnalyzerWrapper.html

-- 
karl

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


Re: Analyzers

Posted by Chris Lu <ch...@gmail.com>.
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 <Sa...@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 <Sa...@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


RE: Analyzers

Posted by "Kainth, Sachin" <Sa...@atkinsglobal.com>.
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 <Sa...@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


Re: Analyzers

Posted by Erick Erickson <er...@gmail.com>.
Use PerFieldAnalyzerWrapper.

On 2/8/07, Kainth, Sachin <Sa...@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.
>