0

I am developing a open blogging website, for its search functionality I am using Elastic search with django-haystack but the problem is after every blog post I need to run the command - python manage.py update_index, how to make update_index automatically ? and could you please tell me if site has millions of posts then, Is this a good idea or it will crash my site because I need to refresh index every time, I am newbie please tell me the correct way for heavy search. What search technologies does instagram and other social websites uses.

1 Answer 1

3

You can enable real time updating by adding this to settings.py:

HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

More details here:

http://django-haystack.readthedocs.io/en/v2.4.1/signal_processors.html#realtime-realtimesignalprocessor

Where the re-indexing is likely to take some time you should use a queue to prevent the request/response cycle being impeded, possible solutions such as celery are suggested here:

http://django-haystack.readthedocs.io/en/v2.4.1/other_apps.html#ref-other-apps

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.