SolrClient is a simple python library for Solr; built in python3 with support for latest features of Solr.
Python
Latest commit 7fcb894 Jan 27, 2017 @nickvasilyev nickvasilyev committed on GitHub removed tavis banner
 since it's not being used anymore

README.md

Documentation Status

SolrClient

SolrClient 0.1.2

SolrClient is a simple python library for Solr; built in python3 with support for latest features of Solr 5 and 6. Development is heavily focused on indexing as well as parsing various query responses and returning them in native python data structures. Several helper classes will be built to automate querying and management of Solr clusters.

Requirements

Features

  • Flexible and simple query mechanism
  • Response Object to easily extract data from Solr Response
  • Cursor Mark support
  • Indexing (raw JSON, JSON Files, gzipped JSON)
  • Specify multiple hosts/IPs for SolrCloud for redundancy
  • Basic Managed Schema field management
  • IndexManager for storing indexing documents off-line and batch indexing them

Getting Started

Installation:

pip install SolrClient

Basic usage:

>>> from SolrClient import SolrClient
>>> solr = SolrClient('http://localhost:8983/solr')
>>> res = solr.query('SolrClient_unittest',{
            'q':'product_name:Lorem',
            'facet':True,
            'facet.field':'facet_test',
    })
>>> res.get_results_count()
4
>>> res.get_facets()
{'facet_test': {'ipsum': 0, 'sit': 0, 'dolor': 2, 'amet,': 1, 'Lorem': 1}}
>>> res.get_facet_keys_as_list('facet_test')
['ipsum', 'sit', 'dolor', 'amet,', 'Lorem']
>>> res.docs
[{'product_name_exact': 'orci. Morbi ipsum 
..... all the docs .... 
 'consectetur Mauris dolor Lorem adipiscing'}]

See, easy.... you just need to know the Solr query syntax.

Roadmap

  • Better test coverage
  • Collection Alias Management
  • Collection Re-indexing with cursor mark
  • More Schema API Action Calls

Contributing

I've realized that that there isn't really a well maintained Solr Python library I liked so I put this together. Contributions (code, tests, documentation) are definitely welcome; if you have a question about development please open up an issue on github page. If you have a pull request, please make sure to add tests and that all of them pass before submitting. See tests README for testing resources.

Documentation: http://solrclient.readthedocs.org/en/latest/