Troubleshooting: Duplicate index field values after merging shards
Some index fields contain duplicate values after merging search indexes from different shards.
Problem
When performing parallel processing (sharding) to build the search index, then merging the index into the master core, the master core contains multiple values for fields that have multiValue set to false in the schema.xml file.
For example, the values might resemble the following
order:
{"catenttype_id_ntk_cs":["ProductBean ","ProductBean ","ProductBean "]
The
expected order should instead
resemble:
{"catenttype_id_ntk_cs":["ProductBean "]
This causes the runtime code to throw an exception, as it expects a single value but instead receives multiple values.
Solution
To resolve this issue, ensure that you delete the data directory under the master core before merging the search indexes.