The filters and tokenizer that are applied to the copy field are
determined by it's type in the schema. Simply create a new field type in
your schema with the filters you would like, and use that type for your
copy field. So, the field description would have it's old type, but the
field suggestion would get a new type.

-Todd Feak

-----Original Message-----
From: Aleksey Gogolev [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 22, 2008 8:28 AM
To: solr-user@lucene.apache.org
Subject: Question about copyField


Hello.

I have field "description" in my schema. And I want make a filed
"suggestion" with the same content. So I added following line to my
schema.xml:

   <copyField source="description" dest="suggestion"/>

But I also want to modify "description" string before copying it to
"suggestion" field. I want to remove all comas, dots and slashes. Here
is an example of such transformation:

"TvPL/st, SAMSUNG, SML200"  => "TvPL st SAMSUNG SML200"

And so as result I want to have such doc:

<doc>
     <field name="id">8asydauf9nbcngfaad</filed>
     <field name="description">TvPL/st, SAMSUNG, SML200</filed>
     <field name="description">TvPL st SAMSUNG SML200</filed>
</doc>

I think it would be nice to use solr.PatternReplaceFilterFactory for
this purpose. So the question is: Can I use solr filters for
processing "description" string before copying it to "suggestion"
field?

Thank you for your attention.

-- 
Aleksey Gogolev
developer, 
dev.co.ua
Aleksey


Reply via email to