Closed M1ha-Shvn closed 7 years ago
Hello, The Elasticsearch id is automatically set to the model instance id, it happens here : https://github.com/liberation/django-elasticsearch/blob/master/django_elasticsearch/managers.py#L127.
And how can I get it back? in deserialize method?
Yes, you can find an exemple of this here: https://github.com/liberation/django-elasticsearch/blob/master/django_elasticsearch/serializers.py#L16.
Hey. My application is built on the bases of basic elasticsearch library. I've decided to ease migrations and installed this extention. Everything is fine except for my system is designed to treat elasticsearch _id as postgresql model id. In this case I can't write custom serializer
deserialize(source)
, which doesn't contain _id field in source parameter. At the same time, it'not clear, how to set up _id inserialize(instance)
method.