-However, as of right now most of the query logic seems to be handled by the ElasticSearch Controllers. Controllers are generally for mediating between Models and Views, and it would be ideal to have the model classes perform their own respective queries/database interactions (perhaps via static methods), rather than bloating the controller logic.
-Having classes inside the controller for the sole purpose of creating new content is also ad-hoc and repetitive: your model code, or at perhaps a data access layer that interacts with the model code would be a better place to create new objects for saving in the database, rather than mixing that with controller logic
TLDR: We should make an adapter class where the adaptee, the data models, is adapted to the ElasticSearchController(ElasticSearchUtils). We should refactor the "temp data classes" we create in the elastic search controller to this adapter.
-However, as of right now most of the query logic seems to be handled by the ElasticSearch Controllers. Controllers are generally for mediating between Models and Views, and it would be ideal to have the model classes perform their own respective queries/database interactions (perhaps via static methods), rather than bloating the controller logic. -Having classes inside the controller for the sole purpose of creating new content is also ad-hoc and repetitive: your model code, or at perhaps a data access layer that interacts with the model code would be a better place to create new objects for saving in the database, rather than mixing that with controller logic
TLDR: We should make an adapter class where the adaptee, the data models, is adapted to the ElasticSearchController(ElasticSearchUtils). We should refactor the "temp data classes" we create in the elastic search controller to this adapter.