Adam
Adam

Reputation: 3128

How to build the index of a single app in Django Haystack - elasticsearch?

I am using Django Haystack with elasticsearch as my search backend.

When I add a new app to my project, it seems I have to run the following command to rebuild the index:

./manage.py rebuild_index

The problem is, I have some very large apps that are already indexed.

How can I only index the new app, given the fact that the app starts initially with thousands of records and not collected one by one.

Thanks.

Upvotes: 1

Views: 991

Answers (1)

Stephen Paulger
Stephen Paulger

Reputation: 5343

https://django-haystack.readthedocs.org/en/latest/management_commands.html?highlight=update_index#update-index

./manage.py update_index

This command can be run specifying a single app and can also update the index for objects that have been updated within a certain timeframe. This makes the indexing process much more efficient so it's well worth learning how to make good use of it.

Upvotes: 2

Related Questions