Question

I am trying to add the partial_fields directive to an elasticsearch query (generated from kibana's table widget).

Where exactly would I have to place this statement in the below ES query?

Already tried to add it right after the first "query" node which produces valid json but still doesn't exclude xmz_Data

    "partial_fields": {
    "partial1": {
        "exclude": "xmz_Data"
    }
},

ES Query

{
  "query": {
    "filtered": {
      "query": {
        "bool": {
          "should": [
            {
              "query_string": {
                "query": "*"
              }
            }
          ]
        }
      },
      "filter": {
        "bool": {
          "must": [
            {
              "match_all": {}
            },
            {
              "bool": {
                "must": [
                  {
                    "match_all": {}
                  }
                ]
              }
            }
          ]
        }
      }
    }
  },
  "highlight": {
    "fields": {},
    "fragment_size": 2147483647,
    "pre_tags": [
      "@start-highlight@"
    ],
    "post_tags": [
      "@end-highlight@"
    ]
  },
  "size": 250,
  "sort": [
    {
      "timestamp": {
        "order": "desc"
      }
    }
  ]
}
Was it helpful?

Solution

You can place the partial_fields directive anywhere in your query, I tested successfully with it both before and after the query node. However, your formatting for the excluded fields value is incorrect. Your exclude fields value needs to be an array. Try this instead...

  "partial_fields": {
     "partial1": {
        "exclude": ["xmz_Data"]
      }
  },
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top