Searching across multiple indices and serializing multiple document types with django-elasticsearch-dsl-drf

Viewed 508

I have the following setup:

Django 3.0.7
Elasticsearch 7.7
django-elasticsearch-dsl
django-elasticsearch-drf

So far I have created 4 different document types and serializers and also 4 different search endpoints.

I have not been able to figure out how to create one endpoint for returning serialized search results from all 4 indices. The serialized search results are all slightly different with different custom fields.

While the endpoints work fine I am not sure how to handle the search without making 4 requests on the front-end each time a search request is submitted. I would also like the results to be paginated so having 4 endpoints is most likely not going to work.

Does anyone have experience with a similar scenario?

0 Answers
Related