h2. Description
Every time you save a field on the search api index fields page, a notice is triggered by the module

Notice: Undefined index: properties in Drupal\search_api_elasticsearch_synonym\EventSubscriber\PrepareIndexMappingSubscriber->prepareIndexMapping() (line 36 of modules/contrib/search_api_elasticsearch_synonym/src/EventSubscriber/PrepareIndexMappingSubscriber.php).

The module is using $mappingParams['body']['properties'] while the properties live 1 lvl deeper.

Comments

nils.destoop created an issue. See original summary.

nils.destoop’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

The attached patch fixes the issue.

dealancer’s picture

Status: Needs review » Fixed

@nils.destoop, thanks, good job!

dealancer’s picture

Status: Fixed » Active

After applying this patch I am noticing the following error on the index rebuild:

Notice: Undefined index: type in Drupal\search_api_elasticsearch_synonym\EventSubscriber\PrepareIndexMappingSubscriber->prepareIndexMapping() (line 36 of modules/contrib/search_api_elasticsearch_synonym/src/EventSubscriber/PrepareIndexMappingSubscriber.php).

dealancer’s picture

Status: Active » Fixed

Looks like we are dealing with different versions of Elasticsearch connector, so I added extra condition to check if type is set.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.