# Termsvector of an element of array

**URL:** https://discuss.elastic.co/t/termsvector-of-an-element-of-array/320732
**Category:** Elasticsearch
**Created:** [December 8, 2022, 3:48am UTC](https://discuss.elastic.co/t/termsvector-of-an-element-of-array/320732 "2022-12-08T03:48:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tim2020work2](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tim2020work2](https://discuss.elastic.co/u/tim2020work2)
#### Post date: [December 8, 2022, 3:48am UTC](https://discuss.elastic.co/t/termsvector-of-an-element-of-array/320732/1 "2022-12-08T03:48:49Z")

</div>

How do I view terms vector of a field in an element of array?

API \_termvectors accept input "fields". i.e

```auto
  "fields" : ["msg"],
}

```

If I want to view term vector of an element of array, the following does not work

```auto
  "fields" : ["object.array[0].msg"],
}

```

with the following response

```auto
{
    "_id": "63772d17e00e205f040903f4",
    "_version": 7173960264797126656,
    "found": true,
    "took": 0,
    "term_vectors": {}
}

```

---

<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: [January 5, 2023, 3:49am UTC](https://discuss.elastic.co/t/termsvector-of-an-element-of-array/320732/2 "2023-01-05T03:49:20Z")

</div>

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