django-es / django-elasticsearch-dsl

This is a package that allows indexing of django models in elasticsearch with elasticsearch-dsl-py.
Other
1.02k stars 261 forks source link

Save Only in Elasticsearch #471

Open iamMHZ opened 8 months ago

iamMHZ commented 8 months ago

Suppose I have a Django model, and I registered the document class for it. django-elasticsearch-dsl uses signals to index data in Elasticsearch, How can I only save data in ElasticSearch using Document class utilities or any other trick?

dziugas505hq commented 8 months ago

I guess that you want to create some management command and then index products by batches? If I can remember correctly, we had implemented a similar logic:

ProductDocument().update(
                qs,
                parallel=self.parallel,
                refresh=self.refresh,
                chunk_size=self.chunk_size,
            )