Reputation: 1093
Context:
SearchIndex
is analogous to django's Model
. It is even tied to a single model via get_model
.
SearchQuerySet
is analogous to django's QuerySet
(except the way of obtaining an instance).
HAYSTACK_CONNECTIONS
are analogous to django's DATABASES
.
One not immediately apparent difference is that performing SearchQuerySet
operations uses ALL SearchIndex
subclasses you have.
How to perform operations on a single SearchIndex (for a single model) only? Connections don't seem to be meant for this.
Upvotes: 1
Views: 387
Reputation: 1093
SearchQuerySet.models
is the answer, buried deep in the docs.
Add .models(DjangoModel1, DjangoModel2)
to your SearchQuerySet calls, where the models are those returned by your chosen SearchIndex
es' get_model
.
Upvotes: 2