Welcome to solr_cli’s documentation!

_images/example.png

Contents:

First steps

Installation

To install solr_cli from Pypi:

pip install mysolr

From source code:

python setup.py install
Dependencies

solr_cli uses a python client called mysolr . So, if you install solr_cli from source code you have to install it.

Execution

Just run ‘solr_cli’ in your shell

Commands

Connecting to solr

connect
solr_url

Url of the index you want to query.

Connects to a solr server located in solr_url. It doesn’t open a real connection it just checks if the server exits and is up.

Examples:

connect http://localhost:8983/solr
connect http://localhost:8983/solr/index_name

Querying to Solr

query
q

Value of the parameter ‘q’.

Makes a simple query to a solr server.

Examples:

query *:*
query type:"book" AND price:[* TO 10]
uri
params

Specify all the http parameters.

Makes a requests to a solr server allowing all http paramaters. Paramenter ‘q’ must be specified.

Example:

uri q=*:*&facet=true&facet.field=price&rows=0

General operations

ping

Checks if the solr server is up. ‘OK’ is printed if so.

commit

Sends a commit to the solr server.

optimize

Sends optimize operation to solr server.

quit

Exit


Fork me on GitHub