Skip to main content

solrcli - Solr CLI

Super simple (and small) Command Line Interface to perform frequend actions upon Solr instance.

Search features are provided from pysolr lib by Django Haystack.

Installation (not yet available)

pip install solrcli

Configuration

Solrcli can take parameters in two ways:

  • via a config file
  • via command line

Using config file allows you to set up different environments. See example below hosts.yml:

production-server:
  host: solr-production.foo.com
  core: products
  sanity_checks:
    column_values_at_least: 
      column: enabled

staging-server:
  host: solr-staging.foo.com
  core: products
  sanity_checks:
    column_values_at_least: 
      column: enabled

You can choose enviroment in the command line as:

(venv) $ python -m solrcli -c hosts.ini -i test-server reload

If you prefer to provide params each time you can pass --host and --core as application options before command.

Usage

Generic options

Print help informations for main command with python -m solrcli --help. Use --help after the command to print specific options.

Usage: solrcli.py [OPTIONS] COMMAND [ARGS]...

Options:
  --host TEXT          Solr hostname with port
  --core TEXT          Solr core
  -c, --config TEXT    config file path
  -i, --instance TEXT  remote instance from config file
  --help               Show this message and exit.

Commands:
  fullimport
  getconfig
  reload
  show-config

Reloading

Invoke core reload

(venv) $ python -m solrcli --host=my-solr-instance.com --core=core0 reload

Configurations

Get config from Solr instance passing feature from the list below:

  • dataimport
(venv) $ python -m solrcli --host=my-solr-instance.com --core=core0 getconfig --feature=dataimport

Status

Get core status. If you use --waitfinish the script will wait until fullimport finish.

The --notify allows you to receive an email with core counts.

Usage: solrcli.py status [OPTIONS]

Options:
  --waitfinish / --no-waitfinish  Wait if data import is running
  --notify TEXT                   Comma separated list of e-mail to deliver
                                  result
  --help                          Show this message and exit.

Full import

Invoke core data import handler.

Usage: solrcli.py fullimport [OPTIONS]

Options:
  --sanitycheck / --no-sanitycheck
                                  Perform full-import only if sanity check
                                  succeded.
  --notify TEXT                   Comma separated list of e-mail to deliver
                                  result
  --help                          Show this message and exit.

The --notify params allows you to receive an e-mail after data import will be completed.

If --sanitycheck is provided fullimport is called only if all sanity checks are passed. Sanity checks to be perfomed can be defined in the settings YAML file in the instance like below:

instances:
  core-test:
    host: my-solr-instance.com
    core: core0
    sanity_checks:
      column_values_at_least: 
        column: published

TODO

  • authentication
  • deeper config inspection
  • focus results: perform a /search or similar and get back only interesting nodes
  • query using URL
  • v2 Api for Solr Cloud

Authors

License

This project is licensed under the GNU Affero General Public License v3.0 License - see the LICENSE file for details

Metadata

Release files for solrcli 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solrcli 0.1.6
File Size Uploaded
solrcli-0.1.6.tar.gz 5.8 kB Details

Release files / solrcli-0.1.6.tar.gz

Download URL solrcli-0.1.6.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4cb5de4be6ac7ebaf7e776c75020fa03bf17dcc8671aeb2c858fd29d48a242b3
BLAKE2b-256 checksum
How to use checksums
e5a7d56e4ab561ca71e6593d81b11c007e1682b1d8b1fa37a78d2c98e685647d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

Release history Release notifications | RSS feed

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

1 release file

0.1.18

1 release file

0.1.17

1 release file

0.1.16

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.12

1 release file

0.1.11

2 release files

0.1.8

1 release file

0.1.7

1 release file

This release

0.1.6 This release

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page