You want to apply elastic-search filters on the API to filter results. You can do this with implementing the
This is done at schema level, allowing you to have multiple search schemas for different query types. Example below is two different queries, one for live content and another for staging.
If this isn't powerful enough and you want full control on the Elasticsearch query before it is requested, you can do this with implementing the method
postProcessRequest. This is done at config level.
If you want to see the query thats being requested to Elasticsearch, use the
DEBUG_MODE=true environment variable to log the query at every request. see Debug Logging