Skip to main content

Solar

This CLI tool provides help with some routine Solr operations:

  • Import / Export data
  • Import / Export configs
  • Re-index Collection (WIP)

Usage

Python version >=3.8 required

pip install solar-cli

Export

Export data

This command will save docs from <collection> to local folder ./data:

solar -c "<collection>" "https://<username>:<password>@localhost:8333" export ./data

Export nested documents

Solr can handle nested documents. To see nested structure of collection usually we add fl="*, [child]" to our query params. Solar can handle exporting nested documents by adding --nested flag:

solar -c "<collection>" "https://<username>:<password>@localhost:8333" export --nested ./data

Export config

If we want to save collection config, we can user export-config command:

solar -c "<collection>" "https://<username>:<password>@localhost:8333" export-config ./configs

This will all config files to local folder ./configs

Import

Import data

Later, we can import previously exported data with import command, and ./data/<collection>.json as source file:

solar "https://<username>:<password>@localhost:8333" import ./data/<collection>.json

We do not have to specify collection name, source .json already have collection name. However, if we want to import data as collection with different name, we can set this with -c flag:

solar -c "<new collection name>" "https://<username>:<password>@localhost:8333" import ./data/<collection>.json

Import config

Solar can help you import configsets to your Solr instance:

solar -c "https://<username>:<password>@localhost:8333" import-config <config folder path>

This command will read files from provide config path, zip them, and send to Solr. By default, created config name will be equal to config folder name. For example, if we import config from ./configs/products, Solar will create config named products.

If we want to override default name, we can use --name flag:

solar -c "https://<username>:<password>@localhost:8333" import-config --name "product-v2" <config folder path>

This will create config product-v2.

Also, we can overwrite existing config with --overwrite flag

This flag will add cleanup=true and overwrite=true params to request for creating config. However it is recommended to create config with the new name, because in some cases, Solr caches fields types, and some changes of new config will not be applied. Goog practice is version control your configs and name them with version identifier (commit hash, for example) Using this flag also requires that no collections is linked to this config

solar -c "https://<username>:<password>@localhost:8333" import-config --overwrite <config folder path>

Other

Remove config

Config <config name> can be removed from Solr with this command:

solar -c "https://<username>:<password>@localhost:8333" remove-config "<config name>"

Metadata

Release files for solar-cli 1.0.0

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

Source distribution (sdist)

Source distribution for solar-cli 1.0.0
File Size Uploaded Provenance
solar_cli-1.0.0.tar.gz 11.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for solar-cli 1.0.0
File Interpreter ABI Platform
solar_cli-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.6 kB

Release files / solar_cli-1.0.0.tar.gz

Download URL solar_cli-1.0.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0a1fa31db1fcde5b0c87508877cdcb561357b850045752eb9c3205ffb4b78806
BLAKE2b-256 checksum
How to use checksums
81e7161422032574d0eab7e4430336f9b813324b2b33a4a47971b14bee190a5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.6 Windows/10

Release files / solar_cli-1.0.0-py3-none-any.whl

Download URL solar_cli-1.0.0-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4918d82da4ad9b25a05427f26f810987e60c782f19789ad7d2b5fe52fa2edc6f
BLAKE2b-256 checksum
How to use checksums
f21c199a8aceb6223e410e9020f2631da22db30af1b896080e9077155a84d765
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.6 Windows/10

Security for solar-cli 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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