Skip to content

Commit

Permalink
Add the SolrCloudIndexer, adding support for SolrCloud/zookeper-backe…
Browse files Browse the repository at this point in the history
…d Solr.
  • Loading branch information
TkTech committed Jun 16, 2016
1 parent 551e46c commit 966677c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ckanext/search/solr.py
Expand Up @@ -103,3 +103,17 @@ def _get_connection(self):
object_hook=solr_datetime_decoder
)
)


class SolrCloudIndexer(SolrIndexer):
"""
An indexer for zookeeper/SolrCloud-backed Solr.
Two values are expected in your configuration:
- solr_url = the array of zookeeper domains
- solr_collection = the name of the solr collection to use
"""
def _get_connection(self):
zookeeper = pysolr.Zookeeper(config['solr_url'])
return pysolr.SolrCloud(zookeeper, config['solr_collection'])

0 comments on commit 966677c

Please sign in to comment.