The elasticquery package provides utilities for building Elasticsearch queries in a simple and intuitive way.
You can install the package from Github with:
# install.packages("remotes")
remotes::install_github("hafen/elasticquery")
See the usage page for a tutorial and examples.