readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

Search: remove django-elasticsearch-dsl dependency

Open stsewd opened this issue 9 months ago • 2 comments

What's the problem this feature will solve?

django-elasticsearch-dsl is useful if you have an exact mapping with a model and one or several indexes in ES. But now that we are no longer tracking all HTML files in the DB, there is no need for that package, we also never made use of the signals feature, and we always have one index per model, and we are indexing just two types of documents, HTMLFile and Project.

Our code base could be simplified a lot if we just use https://elasticsearch-py.readthedocs.io/ directly (django-es-dsl is just an abstraction of that package). And we can also delete several fields from the HTMLFile/ImportedFile model that are just used for search.

Describe the solution you'd like

Just rely on the features that https://elasticsearch-py.readthedocs.io/ provides, which is really similar to what we have with django-es-dsl, since django-es-dsl mainly subclasses the other package to make it work with django models.

Alternative solutions

Keep using django-es-dsl and require ourselves to have a model with attributes we don't need per each document that we have in ES.

Additional context

  • https://github.com/readthedocs/readthedocs.org/pull/10696

stsewd avatar Sep 13 '23 02:09 stsewd