@javlin’s approach is not update safe, it will be overwritten with a stack restart and thus be a pain to maintain.
Note that opensearch officially has no support from Zammad:
https://docs.zammad.org/en/latest/prerequisites/software.html#elasticsearch-optional
This might help you though: