Tag manager
When merging two tags, all the entities that related to those tags need to be updated and reindexed. To avoid having to hydrate hundreds/thousands of entities, the tag merger does this by updating the entities directly in the database. This update also needs to run in ElasticSearch. In order to allow the updating script to run, you must update ElasticSearch's configuration (usually, /etc/elasticsearch/elasticsearch.yml
) with the following:
script.engine.groovy.inline.update: on
script.disable_dynamic: false
Without this configuration, Symfony's log shows an error:
request.CRITICAL: Uncaught PHP Exception Elastica\Exception\ResponseException:
"RemoteTransportException[[elastic_dev][inet[/__SERVER_IP__:9300]]
[indices:data/write/update]];
nested: ElasticsearchIllegalArgumentException[failed to execute script];
nested: ScriptException[scripts of type [inline], operation [update] and lang [groovy] are disabled]; "
at /var/www/project/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php line 147
{"exception":"[object] (
Elastica\\Exception\\ResponseException(code: 0): RemoteTransportException[[elastic_dev][inet[/__SERVER_IP__:9300]][indices:data/write/update]];
nested: ElasticsearchIllegalArgumentException[failed to execute script];
nested: ScriptException[scripts of type [inline],
operation [update] and lang [groovy] are disabled];
at /var/www/project/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:147)"} []
Don't forget to restart ElasticSearch service after updating the configuration file.
ElasticSearch version
Another exception that can be thrown by the tag merger is:
ElasticsearchIllegalArgumentException[failed to execute script];
nested: GroovyScriptExecutionException[
MissingMethodException[No signature of method:
e33a9a74cd4c9b203c23b2653f70ae2efaa49aa8.foreach() is applicable for
argument types: (java.util.LinkedHashMap,
e33a9a74cd4c9b203c23b2653f70ae2efaa49aa8$_run_closure1)
values: [[item:[6016, 6017, 6018]],
e33a9a74cd4c9b203c23b2653f70ae2efaa49aa8$_run_closure1@2c89d67c]
Possible solutions: each(groovy.lang.Closure)]];
To fix this, update app/config/parameters/local.yml
and set the wf_cms.elastic_search_version
parameter to the version of ElasticSearch (only 1.x versions of ElasticSearch server are supported!)