# How to resolve "Infinite extent for field" if the field is not in all ingested documents?

**URL:** https://discuss.elastic.co/t/how-to-resolve-infinite-extent-for-field-if-the-field-is-not-in-all-ingested-documents/342996
**Category:** Kibana
**Tags:** vega
**Created:** [September 14, 2023, 12:15am UTC](https://discuss.elastic.co/t/how-to-resolve-infinite-extent-for-field-if-the-field-is-not-in-all-ingested-documents/342996 "2023-09-14T00:15:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![carollyl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carollyl/32/120726_2.png) [@carollyl](https://discuss.elastic.co/u/carollyl)
#### Post date: [September 14, 2023, 12:15am UTC](https://discuss.elastic.co/t/how-to-resolve-infinite-extent-for-field-if-the-field-is-not-in-all-ingested-documents/342996/1 "2023-09-14T00:15:13Z")

</div>

I have a field named `runtime`, however, it does not present in all ingested document within the index pattern. Is there a way to filter out the document that does not contains the `runtime` field for Vega to work?

```auto
{
  $schema: https://vega.github.io/schema/vega-lite/v5.json
  mark: circle

  data: {
    url: {
      %context%: true
      %timefield%: timestamp

      index: prod-*
      body: {
        size: 10000
        _source: ["timestamp", "simulator", "runtime"]
      }
    }
    
    "transform": [
      {
        "type": "filter",
        "expr": "datum['simulator'] != null && datum['runtime'] != null"
      }
    ]

    format: { property: "hits.hits" }
  }

  encoding: {
    x: {
      field: _source.simulator
      type: ordinal
      axis: { title: "Simulator" }
    }
    y: {
      field: _source.runtime
      type: quantitative
      axis: { title: "Runtime" }
    }
    color: {
      field: _source.simulator
      type: nominal
      legend: { title: "Simulator" }
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 12, 2023, 12:16am UTC](https://discuss.elastic.co/t/how-to-resolve-infinite-extent-for-field-if-the-field-is-not-in-all-ingested-documents/342996/2 "2023-10-12T00:16:05Z")

</div>

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