Skip to content

hotfix: allow saving long summaries and descriptions on prod - #282

Closed
anantjain341 wants to merge 1 commit into
CivicDataLab:mainfrom
anantjain341:hotfix/save-long-summary
Closed

anantjain341 wants to merge 1 commit into
CivicDataLab:mainfrom
anantjain341:hotfix/save-long-summary

Conversation

@anantjain341

Copy link
Copy Markdown
Contributor

Fixes #266 on production.

Use cases and collaboratives with a long summary (and items with a long
description) cannot be saved on prod: the save returns an error. The search
index refuses text over about 32,000 bytes, and saving a published item writes
it to search.

This is only that fix from dev (#278, #281), nothing else from dev.

Changes

  • Long text fields (summary, description, bio) lose the raw sub-field in all
    search documents.
  • Migration 0054_rebuild_long_text_search_indexes: drops and recreates any live
    index that still has such a sub-field; the deploy then refills it. Elasticsearch
    only, no database change. Errors are logged and never fail the migration.

After deploy

  • Search results are empty for a minute or two while the rebuilt indexes refill.
  • No API or response changes.

Before the next dev to main release, main must be merged back into dev with a
merge migration (follow-up PR into dev), so there is a single migration leaf.

Use case and collaborative summaries can be up to 200,000 characters, but
their search mapping kept a keyword-analyzed raw copy that turns the whole
value into one token, and Elasticsearch rejects tokens over 32,766 bytes.
Saving a published item with a long summary returned an error.

Removes those raw sub-fields from the long text fields of all search
documents (same change as CivicDataLab#278 and CivicDataLab#281 on dev) and adds migration 0054,
which drops and recreates any live index still carrying one; the deploy
then refills it.

Fixes CivicDataLab#266
@anantjain341

Copy link
Copy Markdown
Contributor Author

Reopened from a CivicDataLab branch as #283, so the main checks get their secrets.

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.

[Bug]: Elastic search is not able to index large chunk of text in usecase summary.

1 participant