-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple clusters on the same model #69
Comments
Hello, you can use a proxy model, maybe not the cleanest way to do it but there will probably never be an api for that use case. |
Thanks- I've taken your advice, but the new model cluster never gets created. Do I need to send it a signal or something?
|
Yes, unfortunately this is a know django behavior, see https://code.djangoproject.com/ticket/9318. I didn't really dig but you there should be a workaround in the ticket. from django_elasticsearch.managers import ElasticsearchManager
class ItemEsManager(ElasticsearchManager):
def do_index(self):
for serializer in [ItemEsSerializer, NewModelEsSerializer]:
s = serializer(self.model, **kwargs)
body = s.serialize(self.instance)
es_client.index(index=self.index,
doc_type=self.doc_type,
id=self.instance.id,
body=body)
class Item(Model):
es = NewModelEsManager() |
Hi,
I have a use case where I want to use the same model, but which use two different serializers. Each serializer should be on its own elastic-search URL.
Is this possible?
EG:
localhost:9200/django/model-Item/
localhost:9200/django/model-TaskNew/
The text was updated successfully, but these errors were encountered: