-
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
Add elasticsearch index command to Canasta-CLI #60
base: main
Are you sure you want to change the base?
Conversation
Fixes #41 . |
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.
I think this should clarify that this command is for the initial setup, and if you are upgrading your copy of cirrusSearch or if you want to force a reindex, you need to use different commands (At least as far as i can tell, based on docs https://gerrit.wikimedia.org/g/mediawiki/extensions/CirrusSearch/%2B/HEAD/UPGRADE https://gerrit.wikimedia.org/g/mediawiki/extensions/CirrusSearch/%2B/HEAD/README and https://wikitech.wikimedia.org/wiki/Search#Smaller_indices . I am not super familiar with ElasticSearch)
If CirrusSearch is not enabled, you get a really confusing error message: Error from line 722 of /var/www/mediawiki/w/maintenance/includes/Maintenance.php: Class 'CirrusSearch\Maintenance\IndexNamespaces' not found
. I think this command should check if CirrusSearch is enabled, and give a more helpful error message if it is not.
func NewCmdCreate() *cobra.Command { | ||
var elasticsearchCmd = &cobra.Command{ | ||
Use: "elasticsearch", | ||
Short: "A brief description of your command", |
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.
These descriptions should be updated.
func indexCmdCreate() *cobra.Command { | ||
var indexCmd = &cobra.Command{ | ||
Use: "index", | ||
Short: "A brief description of your command", |
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.
ditto
|
||
func ElasticIndex(instance config.Installation) { | ||
fmt.Println("Running maintenance jobs") | ||
orchestrators.Exec(instance.Path, instance.Orchestrator, "web", "php extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php") |
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 UpdateSearchIndexConfig.php
also need --startOver
as recommended by jeffw16
Also a few more scripts were mentioned as part of the set in the issue #41
maintenance/ForceSearchIndex.php --skipLinks --indexOnSkip
maintenance/ForceSearchIndex.php --skipParse
Approach to issue https://github.com/CanastaWiki/Canasta-CLI/issues/41