Save queries elsewhere besides inside Python app

We use Elasticsearch queries inside our Python application, which are quite big. For now we saved them as JSON files, to keep the code a bit clean. But I was wondering if anyone knows a better solution?

I guess it would be nice to save them as "functions", like in PostgreSQL, but I'm not sure if this is even possible in Elasticsearch. Not that I know of, at least. Or store them elsewhere?

What about https://www.elastic.co/guide/en/elasticsearch/reference/7.9/search-template.html?

It seems to be exactly what I was looking for! Thanks a lot !

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.