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 elasticsearch index command to Canasta-CLI #60

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gitmapd
Copy link
Collaborator

@gitmapd gitmapd commented Jan 30, 2023

@yaronkoren
Copy link
Member

Fixes #41 .

Copy link
Contributor

@bawolff bawolff left a 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",
Copy link
Contributor

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",
Copy link
Contributor

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")
Copy link
Collaborator

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

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.

4 participants