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 "canasta elasticsearch index" command #41

Open
yaronkoren opened this issue Nov 3, 2022 · 6 comments · May be fixed by #76
Open

Add "canasta elasticsearch index" command #41

yaronkoren opened this issue Nov 3, 2022 · 6 comments · May be fixed by #76
Labels
good first issue Good for newcomers

Comments

@yaronkoren
Copy link
Member

It would be good to have a "canasta elasticsearch index" command. This would, of course, only be usable if Elasticsearch and the CirrusSearch extension are installed. I'm told the set of actual commands it should call is:

maintenance/UpdateSearchIndexConfig.php
maintenance/ForceSearchIndex.php --skipLinks --indexOnSkip
maintenance/ForceSearchIndex.php --skipParse

...all within the CirrusSearch/ directory. I don't know if that's correct, but it seems like a good starting point.

Potentially there could be other "elasticsearch" sub-commands that it would be useful to have in the future.

@jeffw16
Copy link
Member

jeffw16 commented Nov 3, 2022

That is correct. Maybe add a --force flag (or whatever it's called) to UpdateSearchIndexConfig.php too.

@olsonjaredm
Copy link

olsonjaredm commented Nov 21, 2022

Here are a few commands I use to check the health of ES; not sure if it's helpful, maybe could be incorporated into the new command:

curl -X GET "localhost:9200/_count?pretty" -H 'Content-Type: application/json' -d'
{
    "query": {
        "match_all": {}
    }
}
'

or

curl -X GET "localhost:9200/_cluster/health?pretty"

Gives you some basic info on the cluster/shards and a green/yellow/red health status.

For reference, the index command should print out the script results. I think this is your intent: i.e.:

root@5eaf6089ecd2:/var/www/mediawiki/w# php canasta-extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php
indexing namespaces...
        Indexing namespaces...done
content index...
        Fetching Elasticsearch version...6.8.20...ok
        Scanning available plugins...none
        Picking analyzer...english
        Inferring index identifier...minerva_content_first
                Validating number of shards...ok
                Validating replica range...ok
                Validating shard allocation settings...done
                Validating max shards per node...ok
        Validating analyzers...ok
        Validating mappings...
                Validating mapping...ok
        Validating aliases...
                Validating minerva_content alias...ok
                Validating minerva alias...ok
                Updating tracking indexes...done
general index...
        Fetching Elasticsearch version...6.8.20...ok
        Scanning available plugins...none
        Picking analyzer...english
        Inferring index identifier...minerva_general_first
                Validating number of shards...ok
                Validating replica range...ok
                Validating shard allocation settings...done
                Validating max shards per node...ok
        Validating analyzers...ok
        Validating mappings...
                Validating mapping...ok
        Validating aliases...
                Validating minerva_general alias...ok
                Validating minerva alias...ok
                Updating tracking indexes...done
archive index...
        Fetching Elasticsearch version...6.8.20...ok
        Scanning available plugins...none
        Picking analyzer...english
        Inferring index identifier...minerva_archive_first
                Validating number of shards...ok
                Validating replica range...ok
                Validating shard allocation settings...done
                Validating max shards per node...ok
        Validating analyzers...ok
        Validating mappings...
                Validating mapping...ok
        Validating aliases...
                Validating minerva_archive alias...ok
                Updating tracking indexes...done

@amalpaul54111
Copy link
Collaborator

That is correct. Maybe add a --force flag (or whatever it's called) to UpdateSearchIndexConfig.php too.

Couldn't find a --force flag.
Instead found --startOver: Blow away the identified index and rebuild it with no data. Is this the right one?

@jeffw16
Copy link
Member

jeffw16 commented Dec 15, 2022

Yes, it's --startOver

@chl178
Copy link
Contributor

chl178 commented Mar 17, 2023

@jeffw16
I'm interested in working on this. Could you please assign it to me?

@jeffw16
Copy link
Member

jeffw16 commented Mar 17, 2023

@chl178 Assigned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants