I'm trying to implement search to my django based website.
While following the tutorial I found this:
If you’re using the Solr backend, you have an extra step. Solr’s configuration is XML-based, so you’ll need to manually regenerate the schema. You should
run ./manage.py build_solr_schema
first, drop the XML output in your Solr’s schema.xml file and restart your Solr server.
First, I don't know where to put my schema.xml, after some resarch I figured I'd create a folder inside my project to put it: myprojectname/solr/schema.xml
. Is that right?
Second, how do I restart Solr?
UPDATE
I downloaded Solr,unzipped it and I put the schema.xml generated inside example/solr/conf
then I start solr java -jar start.jar
but when I try to build the index :
./manage.py rebuild_index
I get :
WARNING: This will irreparably remove EVERYTHING from your search index.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
All documents removed.
Indexing 1 News.
Failed to add documents to Solr: [Reason: None]
<response><lst name="responseHeader"><int name="status">400</int><int name="QTime">4</int></lst><lst name="error"><str name="msg">ERROR: [doc=news.news.2] unknown field 'django_id'</str><int name="code">400</int></lst></response>
Indexing 1 entries.
Failed to add documents to Solr: [Reason: None]
<response><lst name="responseHeader"><int name="status">400</int><int name="QTime">17</int></lst><lst name="error"><str name="msg">ERROR: [doc=zinnia.entry.2] unknown field 'django_id'</str><int name="code">400</int></lst></response>
I verified my schema.xml ,and I do have :
<field name="django_ct" type="string" indexed="true" stored="true" multiValued="false" />
<field name="django_id" type="string" indexed="true" stored="true" multiValued="false" />
P.S. I'm using Django 1.2 and Haystack 1.2.7