Filter_path in POST Body

Hey,

the responses I get from Elastisearch are rather huge. I've found out that it is possible to remove data of responses by using response filtering:

Is there any way to put the filter inside a POST body so that I could use in a query like this:

window.fetch(Config.serverUrl, {
      method: 'POST',
      mode: 'cors',
      body: JSON.stringify({
        'query': {     
            'bool': {
              'should': [
                {
                  'match': {
                    'type': 'GatewayClosed'
                  }
                }, {
                  'match': {
                    'type': 'GatewayStarted'
                  }
                }
              ]
            }
        },
        "size": 0,
        "aggregations": {
          "Gateways": {
            "terms": {
              "field": "source.keyword",
              "size": 10000  
            },

            "aggs": {
              "Information": {
                "top_hits": {
                  "sort": [
                    {
                      "@timestamp": {
                        "order": "desc"
                      }
                    }
                  ],
                  "_source": {
                    "includes": ["source", "timestamp", "type"]
                  },
                  "size": 1
                }
              }
            }
          }
        }

      }
)

Hey,

the filter_path always must be a parameter and cannot be included in the body.

--Alex

Alright. Thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.