Tuesday, June 12, 2012

Chaining Solr copyField

Solr does not allow chaining of copyfields and it does not recurse.


e.g.
<!-- Fields defination -->   
<field name="subject" type="text" indexed="true" stored="true"/>   
<field name="subject_text" type="text" indexed="true" stored="true"/>   
<field name="text" type="text" indexed="true" stored="true"/>

<!-- Copying subject field to subject_text field -->   
<copyField source="subject" dest="subject_text"/>

<!-- The subject_text cannot feed into text.So you would land up with no subject being copied -->   
<copyField source="subject_text" dest="text"/> 

Solr Documentation @ http://wiki.apache.org/solr/SchemaXml#Copy_Fields quotes
The copy is done at the stream source level and no copy feeds into another copy.

So a copyfield cannot be a source of other copyfield tag.
The copyfield source must be an actual field, which has some value and does no cascade.

2 comments: