Bucket Selector Aggregation to eliminate null buckets

I'm trying to use the Bucket Selector aggregation to eliminate Null values from other pipeline aggregations without success

First Try of null checking:

"bucket_filter": {
          "bucket_selector": {
            "buckets_path": {
              "var_1": "something_from_movong_fn",
              "var_2": "something_from_movong_fn_1",
              "var_3": "something_from_movong_fn_1"
            },
            "script": "params.var_1 != null"
          }
        }

But not works, null metric are present in result.

Second try, null safe access operator:

"bucket_filter": {
          "bucket_selector": {
            "buckets_path": {
              "var_1": "something_from_movong_fn",
              "var_2": "something_from_movong_fn_1",
              "var_3": "something_from_movong_fn_1"
            },
            "script": "params?.var_1 != null"
          }
        }

But fails null return again.

Third Try (Instance of check):

"bucket_filter": {
          "bucket_selector": {
            "buckets_path": {
              "var_1": "something_from_movong_fn",
              "var_2": "something_from_movong_fn_1",
              "var_3": "something_from_movong_fn_1"
            },
            "script": "params?.var_1 instanceof double"
          }
        }

But fails with or without null safe operator return null values.

Another Try:

"bucket_filter": {
          "bucket_selector": {
            "buckets_path": {
              "var_1": "something_from_movong_fn",
              "var_2": "something_from_movong_fn_1",
              "var_3": "something_from_movong_fn_1"
            },
            "script": "params?.var_1? instanceof double"
          }
        }

But fail no returns nothing.

How can filter the null values on the pipeline aggregation?

Many thanks !

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