I'm trying to set up elastic search on our server. Actually it seems to work, but when i run the product importer (own plugin), then it has exceptions.
So the config is done like described in the documentation: https://docs.shopware.com/en/shopware-6-en/enterprise-extensions/enterprise-search?category=shopware-6-en/enterprise-extensions
But even if all product fields are set to "Not searched" in the settings, the importer runs into this exception:
ERROR [app] object mapping for [customFields.product_processing_fields] tried to parse field [product_processing_fields] as object, but found a concrete value
In ElasticsearchIndexer.php line 210:
[Shopware\Elasticsearch\Exception\ElasticsearchIndexingException]
Following errors occurred while indexing:
object mapping for [customFields.product_processing_fields] tried to parse field [product_proc
essing_fields] as object, but found a concrete value
If i turn off elastic search in the .env file, then the importer runs trough without any issue.
Does anyone has an idea how to solve?
CodePudding user response:
The problem is that the value of the custom field does not correlate to what type it was configured as. Check the type
property of the config
column in the custom_field
table. If it is bool
then the value mustn't be a string for example. You can see where the type is mapped from what is set in your custom field's config to what Elasticsearch will expect by looking at the method CustomFieldUpdater::getTypeFromCustomFieldType
.