Do not log an entry in watchdog if document is not found in the index

Created on 16 August 2023, about 1 year ago

Problem/Motivation

When removing an entity which for some reason is not indexed in Elasticsearch, the following entry is logged in Drupal:

Could not delete document "3" from "example-multilingual-lv" Elasticsearch index due to the following error: 404 Not Found: {"_index":"example-multilingual-lv","_id":"3","_version":3,"result":"not_found","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":13,"_primary_term":1}

While this information might be helpful in general, in some situations these messages are not desired, for example, when entities are generated and removed automatically via an integration.

Steps to reproduce

1. Create a node.
2. Install Elasticsearch Helper and enabled an index plugin (without content re-indexing).
3. Remove the node.
4. See that the 404 message from Elasticsearch is logged.

Proposed resolution

Provide an option to enable silent document removal (without logging).

Feature request
Status

Fixed

Version

8.0

Component

Code

Created by

🇱🇻Latvia maijs

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024