Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Recipe to set up SOLR with django-haystack

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time



This is a recipe to set up and configure SOLR in a django-haystack environment.

Basic setup

A basic buildout configuration using this recipe looks like this (using djc.recipe):

eggs = django-haystack
parts =

recipe = djc.recipe
project = dummydjangoprj

recipe =
url =
strip-top-level-dir = true

recipe = abstract.recipe.haystack-solr
solr-location = ${solr-download:location}
django-settings-file = ${django:location}/
eggs =

This will download SOLR and create an executable at bin/solr. The name of the script is the name of the section.

To test the setup run bin/solr fg and check the console output. By default this will run a Jetty server on port 8080. The SOLR instance is accessible in a browser at

When SOLR is started the first time, django-haystack is invoked to create the SOLR schema: the same will happen (overwriting any existing schema) if you run bin/solr reset.

SOLR will write all its log files into var/solr/log. All its configuration including jobs and past runs will go into var/solr/data. The directory name in var will have the name of the recipe section.


The recipe supports the following options:

Optional. The eggs the solr script should load. Since django-haystack is invoked, it must be atleast all the eggs that are necessary to run Django management commands.
If your Django settings are in a module in sys.path, put here the module name. Either this or django-settings-file should be specified.
If your Django settings are in a file not in sys.path, put here the file name. Either this or django-settings should be specified.
The location of the part where the SOLR distribution has been downloaded.
Optional. The file name containing the SOLR config (solrconfig.xml).

Optional. Parameters to pass to the Java Virtual Machine (JVM) used to run Jetty. Each option is specified on a separated line. If you run into memory problems it's typical to pass:

java-opts =
Optional. Extra arguments to pass to the Java Virtual Machine (JVM): this are typically all the parameters you'd pass after the jar file.
Optional chunk of code that is needed prior to Django bootstrapping.
Environment variables needed prior to Django bootstrapping.


The code and issue tracker can be found at:

Something went wrong with that request. Please try again.