Open kevinschaper opened 7 years ago
What about using something like the following:
https://github.com/Fizzadar/ElasticQuery https://github.com/elastic/elasticsearch-dsl-py
We could have each Domain Model now how to map itself, and build a query for itself. Field lists could be generated from each DM?
We wouldn't have to manage "template" files, where field names change in the mapping file and in the template files and in the DM. The mapping and query building could be generated directly from a DM and then we would only need to change fields in one spot.
Definitely an improvement. I do hope we eventually will put our 'base data' into a relational database and then use some kind of ORM (object-relational-mapping) to talk to the database.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
It looks like we can build stored templates for the queries. They can be pushed into the ES cluster (like the mapping is), and should make it much easier to tune & debug queries.