[Fixed]-How to rebuild_index in Django Haystack

1👍

This is because your django development server is not running.

In order to keep both servers running (solr and Django), run solr in the background and then run Django dev server.
So, assuming that the solr server is inside your home dir then run it first:

cd ~/solr-version/example/

java -jar start.jar --daemon &

HINT: If you want to kill the background solr server do: ps aux | grep java and you should get something like this

username 3432 134 1.1 2431016 93196 Sl 09:52 0:06 java -jar start.jar --daemon
username 3466 0.0 0.0 11744 932 S+ 09:52 0:00 grep --colour=auto java

The second column marks the pid of the process, so to kill it, do:

kill 3432

Now you can run Django dev server by going to the root of your project and ./manage.py runserver

As for your second question: No it doesn’t need to be rerun every time code changes assuming you are using django-haystack RealTimeSignalProcessor. It is very very simple. Each time a model is updated (i.e an entry is added, changed, deleted) the index will be update automatically!

Hope this helps you!

👤nik_m

Leave a comment