From 510608decb5e4ce5b6184d86662af5bd33e1be11 Mon Sep 17 00:00:00 2001
From: Steve Rowe
* This processor takes as configuration a sequence of zero or more "typeMapping"-s from
- * one or more "valueClass"-s, specified as either an <arr> of <str>, or
- * multiple <str> with the same name, to an existing schema "fieldType".
+ * one or more "valueClass"-s, specified as either an <arr>
of
+ * <str>
, or multiple <str>
with the same name,
+ * to an existing schema "fieldType".
*
* If more than one "valueClass" is specified in a "typeMapping", field values with any
* of the specified "valueClass"-s will be mapped to the specified target "fieldType".
* The "typeMapping"-s are attempted in the specified order; if a field value's class
* is not specified in a "valueClass", the next "typeMapping" is attempted. If no
- * "typeMapping" succeeds, then the specified "defaultFieldType" is used.
+ * "typeMapping" succeeds, then either the "typeMapping" configured with
+ * <bool name="default">true</bool>
is used, or if none is so
+ * configured, the lt;str name="defaultFieldType">...</str>
is
+ * used.
+ *
+ * Zero or more "copyField" directives may be included with each "typeMapping", using a
+ * <lst>
. The copy field source is automatically set to the new field
+ * name; "dest" must specify the destination field or dynamic field in a
+ * <str>
; and "maxChars" may optionally be specified in an
+ * <int>
.
*
* Example configuration: *
* *- * <processor class="solr.AddSchemaFieldsUpdateProcessorFactory"> - * <str name="defaultFieldType">text_general</str> + * <updateProcessor class="solr.AddSchemaFieldsUpdateProcessorFactory" name="add-schema-fields"> * <lst name="typeMapping"> - * <str name="valueClass">Boolean</str> + * <str name="valueClass">java.lang.String</str> + * <str name="fieldType">text_general</str> + * <lst name="copyField"> + * <str name="dest">*_str</str> + * <int name="maxChars">256</int> + * </lst> + * <!-- Use as default mapping instead of defaultFieldType --> + * <bool name="default">true</bool> + * </lst> + * <lst name="typeMapping"> + * <str name="valueClass">java.lang.Boolean</str> * <str name="fieldType">booleans</str> * </lst> * <lst name="typeMapping"> - * <str name="valueClass">Integer</str> - * <str name="fieldType">pints</str> - * </lst> - * <lst name="typeMapping"> - * <str name="valueClass">Float</str> - * <str name="fieldType">pfloats</str> - * </lst> - * <lst name="typeMapping"> - * <str name="valueClass">Date</str> + * <str name="valueClass">java.util.Date</str> * <str name="fieldType">pdates</str> * </lst> * <lst name="typeMapping"> - * <str name="valueClass">Long</str> - * <str name="valueClass">Integer</str> + * <str name="valueClass">java.lang.Long</str> + * <str name="valueClass">java.lang.Integer</str> * <str name="fieldType">plongs</str> * </lst> * <lst name="typeMapping"> - * <arr name="valueClass"> - * <str>Double</str> - * <str>Float</str> - * </arr> + * <str name="valueClass">java.lang.Number</str> * <str name="fieldType">pdoubles</str> * </lst> - * </processor>+ * </updateProcessor> */ public class AddSchemaFieldsUpdateProcessorFactory extends UpdateRequestProcessorFactory implements SolrCoreAware, UpdateRequestProcessorFactory.RunAlways {