Skip to content

fix(search): upsert ES updates and retry failed bulk indexes (#2523)#2792

Open
Tarekchehahde wants to merge 1 commit into
IFRCGo:developfrom
Tarekchehahde:fix/issue-2523-es-index-upsert
Open

fix(search): upsert ES updates and retry failed bulk indexes (#2523)#2792
Tarekchehahde wants to merge 1 commit into
IFRCGo:developfrom
Tarekchehahde:fix/issue-2523-es-index-upsert

Conversation

@Tarekchehahde

Copy link
Copy Markdown

Summary

  • Set doc_as_upsert=True on Elasticsearch update actions (missing documents are created instead of failing)
  • Improve error logging with model/pk context in utils/elasticsearch.py
  • Retry index_and_notify bulk failures per record

Test plan

  • Staging: verify events/appeals/field reports index after update when ES doc was missing
  • Monitor Sentry for reduced "failed to index" errors

Fixes #2523

Made with Cursor

…2523)

Use doc_as_upsert for update operations and retry index_and_notify bulk
failures per record to reduce "failed to index" Sentry noise.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PROD] Document(s) failed to index

1 participant