# Exists Query on Vector Field

**URL:** https://forum.opensearch.org/t/exists-query-on-vector-field/8213
**Category:** k-NN
**Created:** [January 5, 2022, 10:15pm UTC](https://forum.opensearch.org/t/exists-query-on-vector-field/8213 "2022-01-05T22:15:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dnock](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dnock](https://forum.opensearch.org/u/dnock)
#### Post date: [January 5, 2022, 10:15pm UTC](https://forum.opensearch.org/t/exists-query-on-vector-field/8213/1 "2022-01-05T22:15:35Z")

</div>

Hello! For a feature I’m working on I need to know how many documents in my index actually have a vector field indexed. I assumed a simple exists query would do the trick, but though there are documents with vectors indexed my query always shows that there are no hits. Is there some other way to calculated the value I am looking for?

query example:

```auto
GET /index/_search
{
  "query": {
    "exists": {
      "field": "nexted.vector.field"
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![jmazane](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@jmazane](https://forum.opensearch.org/u/jmazane)
#### Post date: [January 10, 2022, 11:30pm UTC](https://forum.opensearch.org/t/exists-query-on-vector-field/8213/2 "2022-01-10T23:30:13Z")

</div>

Hi @dnock

Which version is your cluster? Awhile back we had a similar issue that got fixed in ODFE 1.11: [existsQuery knn vecter is not run！ · Issue #197 · opendistro-for-elasticsearch/k-NN · GitHub](https://github.com/opendistro-for-elasticsearch/k-NN/issues/197/).

Jack

---

<div class="post-metadata">

### Author: ![dnock](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dnock](https://forum.opensearch.org/u/dnock)
#### Post date: [January 11, 2022, 2:51pm UTC](https://forum.opensearch.org/t/exists-query-on-vector-field/8213/3 "2022-01-11T14:51:03Z")

</div>

We’re on version 7.1. According that thread 7.9 is needed.

Thanks,  
Dylan
