Command Line Tools

This enhancement is in Beta please help by providing us your feedback!

SuiteCRM’s Elasticsearch integration ships with two useful command line tools powered by Robo.

These two commands allow to perform indexing and searches from the command line, making debug and integration with external tools easier.

These commands require a working connection to the database, if you are running SuiteCRM behind Docker or a VM, please execute them from a shell on the same host as the SuiteCRM web server.

elastic:index

The elastic:index command allows to run an indexing from the command line and see the step-by-step logs. Both partial and full indexing are supported.

Usage

elastic:index [<differential> = 1]

Examples

Running a full indexing:

vendor/bin/robo elastic:index 1

Running a partial indexing:

vendor/bin/robo elastic:index 0

Elasticsearch Index CLI

The elastic:search command allows you to perform the same kind of queries you would do from the search bar directly from the CLI. It also allows to return a JSON with additional data about the record.

Usage

elastic:search <query> [<size> = 20] [<showJson> = false]

You can use the full query syntax for for query argument.

The size option specifies the number of results.

When the showJson option is enabled a json will be returned for each result

Examples

Search for everything using the keyword 'rohan':

vendor/bin/robo elastic:search "rohan"

Elasticsearch CLI

Search for the first account named 'Maxwell' and show a JSON:

vendor/bin/robo elastic:search "_type:Accounts AND named:Maxwell" 1 true

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.