Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2606] Lazy load synonyms for Elasticsearch #1295

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

pi-sigma
Copy link
Contributor

@pi-sigma pi-sigma commented Jul 4, 2024

The synonyms for Elastic Search need to be loaded after all the migrations have been run.

Taiga: issue #2606

@pi-sigma pi-sigma force-pushed the fix/elastic-synonyms branch 2 times, most recently from f754665 to a50c2af Compare July 4, 2024 14:32
   - the synonyms need to be loaded after all the migrations
     have been run
@pi-sigma pi-sigma force-pushed the fix/elastic-synonyms branch from a50c2af to e196a72 Compare July 11, 2024 07:54
@pi-sigma pi-sigma changed the title Fix loading of synonyms for elastic search [#2606] Lazy load synonyms for Elasticsearch Jul 11, 2024
@pi-sigma pi-sigma added discussion Marked for discussion on hold Pause working for now, continued after decisions labels Jul 24, 2024
@pi-sigma
Copy link
Contributor Author

Some thoughts:

  • Wrapping load_synonyms in lazy doesn't work (without further ado) because it causes a SerializationError
  • We played with the idea of loading synonyms in the ready function and patch ProductDocument, but the solution is neither pretty nor straightforward.

@swrichards
Copy link
Contributor

Some thoughts:

* Wrapping `load_synonyms` in `lazy` doesn't work (without further ado) because it causes a `SerializationError`

* We played with the idea of loading synonyms in the `ready` function and patch `ProductDocument`, but the solution is neither pretty nor straightforward.

Just to add to this: when @alextreme is back we might want to discuss whether this approach is viable at all. There does not appear to be any good way to load synonyms from a Django model (which can only work post-django setup) to be passed into the Document definition (which happens pre-django setup), without doing some ugly monkey-patching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Marked for discussion on hold Pause working for now, continued after decisions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants