Installing Django1.5-Haystack-2.0.0-beta with Solr-4.2.1

Install Haystack with his dependency pysolr


Install the solr-4.2.1 by following the steps

Follow the tutorial to configure haystack

Configuring Solr-4.2.1

  • Use the command build_solr_schema to generate the schema.xml file

  • Copy the schema.xml file to the following directory


    NOTE: The conf directory changed in this version

  • Add the following line in the section in the schema.xml

<field name="_version_" type="long" indexed="true" stored ="true"/>
Otherwise, the following exception will be thrown
Caused by: org.apache.solr.common.SolrException: _version_field must exist in schema, 
using indexed="true" stored="true" and multiValued="false" (_version_ does not exist)
  • Update the stopwordsen.txt path in the schema.xml to “lang/stopwordsen.txt”

    Otherwise, the following exception will be thrown Can't find resource 'stopwords_en.txt' in classpath 
or 'solr/collection1/conf/', cwd=solr/solr-4.2.1/example`
This entry was posted in Django and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *