[Django]-Haystack Multiple Indices – indexed same even there are different search_indexes

8👍

You can exclude indexes using key EXCLUDED_INDEXES:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE':
        'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://127.0.0.1:9200/',
        'INDEX_NAME': 'haystack',
        'EXCLUDED_INDEXES': ['my_destination_app.search_indexes.DestinationIndex'],
    },
    'autocomplete': {
        'ENGINE':
        'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://127.0.0.1:9200/',
        'INDEX_NAME': 'autcomplete',
        'EXCLUDED_INDEXES': ['my_product_app.search_indexes.ProductIndex'],
    }
}

Leave a comment