You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by P Franks <pf...@gmail.com> on 2009/12/09 19:13:01 UTC

copyField question

All,

  Can one use the copyField option and copy a TextField field into a
longField field?  I have some data that i want to extract (filter) out all
but the long and/or integer values.

Example data:    xxx yyy aaa 504 yyy 444234 eeeeeee hhhhhh

I have the copyField in place and the destination field gets the numberic
terms after filtering,  514 444234, when the destination field is a
TextField.

I then stopped solr, deleted all the files in the data directory, changed
the destination field type to longField, started solr, and then inserted a
few documents.  When i use the schema browser so look at the top N values in
the destination field i see the whole copied text for the terms and not the
numeric values I expected.

The top terms for the the destination field looked like:  xxx yyy aaa 504
yyy 444234 eeeeeee hhhhhh

Any idea why I might be seeing this?

I did find something that might be better suited for what I want to do and
that is the TeeToken and TeeSinkToken filters.  Are those filters usable
from solr?  I guess I'll find out in a few minutes when i try to configure
solr to use them.

Thanks,

Pete

Re: copyField question

Posted by P Franks <pf...@gmail.com>.
Thanks.  I will take a look at the TokenFilter.


On Wed, Dec 9, 2009 at 11:44 PM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> On Wed, Dec 9, 2009 at 11:43 PM, P Franks <pf...@gmail.com> wrote:
>
> > All,
> >
> >  Can one use the copyField option and copy a TextField field into a
> > longField field?  I have some data that i want to extract (filter) out
> all
> > but the long and/or integer values.
> >
> >
> No, that won't work. It'd be best to use a TokenFilter which remove
> characters and just keeps the integer/long values. But you still won't be
> able to use the LongField because that is not analyzed (so your token
> filters will not be applied).
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: copyField question

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Dec 9, 2009 at 11:43 PM, P Franks <pf...@gmail.com> wrote:

> All,
>
>  Can one use the copyField option and copy a TextField field into a
> longField field?  I have some data that i want to extract (filter) out all
> but the long and/or integer values.
>
>
No, that won't work. It'd be best to use a TokenFilter which remove
characters and just keeps the integer/long values. But you still won't be
able to use the LongField because that is not analyzed (so your token
filters will not be applied).

-- 
Regards,
Shalin Shekhar Mangar.