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

Add reindexing command line with rate and time estimate #400

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

liamwhite
Copy link
Contributor

@liamwhite liamwhite commented Jan 11, 2025

No imports, no aliases. Just easy and fast reindexing with automatic progress reports for production maintenance.

iex(1)> Philomena.SearchIndexer.recreate_reindex_schema_destructive!(Philomena.Tags.Tag)
Philomena.Tags.Tag: 433106/753474 [150034/sec], ETA: about 3 second(s)
Philomena.Tags.Tag: 753474/753474 [141754/sec], done.
:ok

These will attempt to completely max out the machine to do indexing during a downtime. If this is not desired (e.g., a live reindex), then the following can be used instead to explicitly control the level of concurrency used by the task:

Philomena.SearchIndexer.reindex_schema(Philomena.Images.Image, max_concurrency: 2)

Functions from the SearchIndexer module:

  • Philomena.SearchIndexer.recreate_reindex_all_destructive!(): delete, recreate and reindex all search indices
  • Philomena.SearchIndexer.recreate_reindex_schema_destructive!(Philomena.Tags.Tag): delete, recreate and reindex specific search index
  • Philomena.SearchIndexer.reindex_schema!(Philomena.Images.Image): reindex specific search index, without recreating it

@Meow
Copy link
Member

Meow commented Jan 12, 2025

Add an option to throttle them for live reindexes.

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.

2 participants