RE: Trim and copy a solr field

2011-12-15 Thread Swapna Vuppala
Hi Juan,

I think UpdateProcessor is what I would be needing. Can you please tell me more 
about it, as to how it works and all ?

Thanks and Regards,
Swapna.

-Original Message-
From: Juan Grande [mailto:juan.gra...@gmail.com] 
Sent: Thursday, December 15, 2011 11:43 PM
To: solr-user@lucene.apache.org
Subject: Re: Trim and copy a solr field

Hi Swapna,

Do you want to modify the *indexed* value or the *stored* value? The
analyzers modify the indexed value. To modify the stored value, the only
option that I'm aware of is to write an UpdateProcessor that changes the
document before it's indexed.

*Juan*



On Tue, Dec 13, 2011 at 2:05 AM, Swapna Vuppala wrote:

> Hi Juan,
>
> Thanks for the reply. I tried using this, but I don't see any effect of
> the analyzer/filter.
>
> I tried copying my Solr field to another field of the type defined below.
> Then I indexed couple of documents with the new schema, but I see that both
> fields have got the same value.
> Am looking at the indexed data in Luke.
>
> Am assuming that analyzers process the field value (as specified by
> various filters etc) and then store the modified value. Is that true ? What
> else could I be missing here ?
>
> Thanks and Regards,
> Swapna.
>
> -Original Message-
> From: Juan Grande [mailto:juan.gra...@gmail.com]
> Sent: Monday, December 12, 2011 11:50 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Trim and copy a solr field
>
> Hi Swapna,
>
> You could try using a copyField to a field that uses
> PatternReplaceFilterFactory:
>
>
>  
>
> replacement="$1"/>
>  
>
>
> The regular expression may not be exactly what you want, but it will give
> you an idea of how to do it. I'm pretty sure there must be some other ways
> of doing this, but this is the first that comes to my mind.
>
> *Juan*
>
>
>
> On Mon, Dec 12, 2011 at 4:46 AM, Swapna Vuppala  >wrote:
>
> > Hi,
> >
> > I have a Solr field that contains the absolute path of the file that is
> > indexed, which will be something like
> >
> file:/myserver/Folder1/SubFol1/Sub-Fol2/Test.msg.
> >
> > Am interested in indexing the location in a separate field.  I was
> looking
> > for some way to trim the field value from last occurrence of char "/", so
> > that I can get the location value, something like
> >
> file:/myserver/Folder1/SubFol1/Sub-Fol2,
> > and store it in a new field. Can you please suggest some way to achieve
> > this ?
> >
> > Thanks and Regards,
> > Swapna.
> > 
> > Electronic mail messages entering and leaving Arup  business
> > systems are scanned for acceptability of content and viruses
> >
>


Re: Trim and copy a solr field

2011-12-15 Thread Juan Grande
Hi Swapna,

Do you want to modify the *indexed* value or the *stored* value? The
analyzers modify the indexed value. To modify the stored value, the only
option that I'm aware of is to write an UpdateProcessor that changes the
document before it's indexed.

*Juan*



On Tue, Dec 13, 2011 at 2:05 AM, Swapna Vuppala wrote:

> Hi Juan,
>
> Thanks for the reply. I tried using this, but I don't see any effect of
> the analyzer/filter.
>
> I tried copying my Solr field to another field of the type defined below.
> Then I indexed couple of documents with the new schema, but I see that both
> fields have got the same value.
> Am looking at the indexed data in Luke.
>
> Am assuming that analyzers process the field value (as specified by
> various filters etc) and then store the modified value. Is that true ? What
> else could I be missing here ?
>
> Thanks and Regards,
> Swapna.
>
> -Original Message-
> From: Juan Grande [mailto:juan.gra...@gmail.com]
> Sent: Monday, December 12, 2011 11:50 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Trim and copy a solr field
>
> Hi Swapna,
>
> You could try using a copyField to a field that uses
> PatternReplaceFilterFactory:
>
>
>  
>
> replacement="$1"/>
>  
>
>
> The regular expression may not be exactly what you want, but it will give
> you an idea of how to do it. I'm pretty sure there must be some other ways
> of doing this, but this is the first that comes to my mind.
>
> *Juan*
>
>
>
> On Mon, Dec 12, 2011 at 4:46 AM, Swapna Vuppala  >wrote:
>
> > Hi,
> >
> > I have a Solr field that contains the absolute path of the file that is
> > indexed, which will be something like
> >
> file:/myserver/Folder1/SubFol1/Sub-Fol2/Test.msg.
> >
> > Am interested in indexing the location in a separate field.  I was
> looking
> > for some way to trim the field value from last occurrence of char "/", so
> > that I can get the location value, something like
> >
> file:/myserver/Folder1/SubFol1/Sub-Fol2,
> > and store it in a new field. Can you please suggest some way to achieve
> > this ?
> >
> > Thanks and Regards,
> > Swapna.
> > 
> > Electronic mail messages entering and leaving Arup  business
> > systems are scanned for acceptability of content and viruses
> >
>


RE: Trim and copy a solr field

2011-12-12 Thread Swapna Vuppala
Hi Juan,

Thanks for the reply. I tried using this, but I don't see any effect of the 
analyzer/filter.

I tried copying my Solr field to another field of the type defined below. Then 
I indexed couple of documents with the new schema, but I see that both fields 
have got the same value.
Am looking at the indexed data in Luke.

Am assuming that analyzers process the field value (as specified by various 
filters etc) and then store the modified value. Is that true ? What else could 
I be missing here ?

Thanks and Regards,
Swapna.

-Original Message-
From: Juan Grande [mailto:juan.gra...@gmail.com] 
Sent: Monday, December 12, 2011 11:50 PM
To: solr-user@lucene.apache.org
Subject: Re: Trim and copy a solr field

Hi Swapna,

You could try using a copyField to a field that uses
PatternReplaceFilterFactory:


  


  


The regular expression may not be exactly what you want, but it will give
you an idea of how to do it. I'm pretty sure there must be some other ways
of doing this, but this is the first that comes to my mind.

*Juan*



On Mon, Dec 12, 2011 at 4:46 AM, Swapna Vuppala wrote:

> Hi,
>
> I have a Solr field that contains the absolute path of the file that is
> indexed, which will be something like
> file:/myserver/Folder1/SubFol1/Sub-Fol2/Test.msg.
>
> Am interested in indexing the location in a separate field.  I was looking
> for some way to trim the field value from last occurrence of char "/", so
> that I can get the location value, something like
> file:/myserver/Folder1/SubFol1/Sub-Fol2,
> and store it in a new field. Can you please suggest some way to achieve
> this ?
>
> Thanks and Regards,
> Swapna.
> 
> Electronic mail messages entering and leaving Arup  business
> systems are scanned for acceptability of content and viruses
>


Re: Trim and copy a solr field

2011-12-12 Thread Juan Grande
Hi Swapna,

You could try using a copyField to a field that uses
PatternReplaceFilterFactory:


  


  


The regular expression may not be exactly what you want, but it will give
you an idea of how to do it. I'm pretty sure there must be some other ways
of doing this, but this is the first that comes to my mind.

*Juan*



On Mon, Dec 12, 2011 at 4:46 AM, Swapna Vuppala wrote:

> Hi,
>
> I have a Solr field that contains the absolute path of the file that is
> indexed, which will be something like
> file:/myserver/Folder1/SubFol1/Sub-Fol2/Test.msg.
>
> Am interested in indexing the location in a separate field.  I was looking
> for some way to trim the field value from last occurrence of char "/", so
> that I can get the location value, something like
> file:/myserver/Folder1/SubFol1/Sub-Fol2,
> and store it in a new field. Can you please suggest some way to achieve
> this ?
>
> Thanks and Regards,
> Swapna.
> 
> Electronic mail messages entering and leaving Arup  business
> systems are scanned for acceptability of content and viruses
>