How to update a specific model in Django Haystack (Solr)

I have 2 models that I want to save and index in Solr.

Foo and Moo.

Now for this I have created 2 cores Foo and Moo in Solr.

In the settings file, I created 2 indexes for this.

HAYSTACK_CONNECTIONS = {
'default': {
    'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
    'URL': 'http://127.0.0.1:8983/solr/Foo'
},
'Moo': {
    'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
    'URL': 'http://127.0.0.1:8983/solr/Moo'
},

}

Now, updating or restoring the index, I want to update the kernel only with the specific model in which it is stored. i.e.

python manage.py rebuild_index -model Foo -using default
python manage.py rebuild_index -model Moo -using Moo

Is there any way to do this? Or are my concepts wrong? I am very new to Solr and Hasytack, and the documentation is not very clear. Please comment, I will update the answer.

+4
source share

All Articles