-
Notifications
You must be signed in to change notification settings - Fork 14
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
Added "canasta elasticsearch index" command #76
base: main
Are you sure you want to change the base?
Conversation
@chl178 Can you try CanastaWiki/Canasta#223? Basically, it would be doing CanastaWiki/Canasta#218 except refactor almost all of the |
@chl178 - this looks great! And well-documented. It certainly looks correct; hopefully someone can test it soon. Yes, @jeffw16 is right that adding that maintenance-scripts/ directory would be a great next task, if you want to do another one. Although I have a correction: it wouldn't be that much of the run-apache.sh script that has to get refactored. Also, I'm not sure that looking at the Taqasta code would help that much (maybe it would, I don't know). If you follow the explanation in the task description, you should be fine. Although of course let us know if you have questions. |
@jeffw16 @yaronkoren Thank you for your suggestions, I would like to try #223. |
Go for it |
func initializeIndex(instance config.Installation) { | ||
fmt.Println("Running search index initialization process...") | ||
orchestrators.Exec(instance.Path, instance.Orchestrator, "web", "php extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php --startOver") | ||
orchestrators.Exec(instance.Path, instance.Orchestrator, "web", "php extensions/CirrusSearch/maintenance/ForceSearchIndex.php --skipLinks --indexOnSkip") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CirrusSearch README states that before running the scripts, it's necessary to enable $wgDisableSearchUpdate
flag and then disable it back once all the operations are completed
Frankly, I did not notice any issues running the scripts with the flag kept disabled, but it still may worth to be considered
@vedmaka - @jeffw16 and I were just talking about this PR. Neither of us could remember why these three scripts need to be called in this specific order (if they do). I know that it's been almost a year, but - do you know the reason for this order, if there is one? Oops, I put this comment in the wrong PR! Please ignore this one. |
@yaronkoren so the question is for some other PR, right? not related to ElasticSearch? |
That's right - it was actually for CanastaWiki/Canasta#269 . |
Fixes #41
Summary
This PR adds the canasta elasticsearch index command to the Canasta CLI, which allows users to easily initialize the search index for a Canasta instance. This new command will make it more convenient for users to set up and manage the Elasticsearch indices and clusters associated with their Canasta installations.
Changes
Create a new elasticsearch package for managing Elasticsearch indices and clusters for Canasta.
Add indexCmdCreate() function in the elasticsearch package to create a new Cobra command for initializing the search index for a Canasta instance.
Add initializeIndex() function in the elasticsearch package to perform the actual index initialization process.
Add NewCmdCreate() function in the elasticsearch package to create a new Cobra command for managing Elasticsearch.
Update the root CLI command to include the new elasticsearch package and its commands.
Test
Test the new command by following these steps:
Check out this branch and build the CLI tool.
Use an existing Canasta instance
Run the canasta elasticsearch index command with the appropriate flags
Verify that the search index initialization process completes successfully and the Elasticsearch indices and clusters are configured correctly.
Please let me know if you have any questions or concerns about the changes in this PR.