How do I create a concatenated field via schema.xml?
I am using Solr, version 8.2
In my schema, fields ending in "_s" are of string type, fields ending in
"_t" are of text type, and fields ending in "_txt" are multivalue text type.
<dynamicField name="*_s" type="string" indexed="true" stored="true" />
<dynamicField name="*_t" type="text_general" indexed="true"
stored="true"/>
<dynamicField name="*_txt" type="text_general" indexed="true"
stored="true" multiValued="true"/>
I need to create a field that concatenates the fields BrandName_s and
ManufacturerNo_s
I have tried
<copyField source="BrandName_s" dest="BrandMfgConcat_t" />
<copyField source="ManufacturerNo_s" dest="BrandMfgConcat_t" />
However, when indexing, I get an error.
Error adding field 'ManufacturerNo_s'='6852806' msg=Multiple values
encountered for non multiValued copy field BrandMfgConcat_t: 6852806
I tried
<copyField source="BrandName_s" dest="BrandMfgConcat_txt" />
<copyField source="ManufacturerNo_s" dest="BrandMfgConcat_txt" />
However, the resulting field BrandMfgConcat_txt is an array of the 2
values, not a concatenation.
I tried
<updateRequestProcessorChain name="concatFields">
<processor class="solr.CloneFieldUpdateProcessorFactory">
<str name="source">BrandName_s</str>
<str name="source">ManufacturerNo_s</str>
<str name="dest">BrandMfgConcat_t</str>
</processor>
<processor class="solr.ConcatFieldUpdateProcessorFactory">
<str name="fieldName">BrandMfgConcat_t</str>
</processor>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
However, after indexing, the field BrandMfgConcat_t does not appear in the
record
*Yirmiyahu Fischer*
*Senior Developer | **Tel**:* *03-9578900 *
*E**mail: **[email protected]* <[email protected]>* | **W*
*eb: **www.signature-it.com* <http://www.signature-it.com/>