# How to Index multiple fields receiving an Array

**URL:** <https://discuss.elastic.co/t/how-to-index-multiple-fields-receiving-an-array/181866>\
**Category:** Elasticsearch\
**Created:** [May 20, 2019, 3:47pm UTC](https://discuss.elastic.co/t/how-to-index-multiple-fields-receiving-an-array/181866 "2019-05-20T15:47:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheusribeirogarcia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matheusribeirogarcia/32/44363_2.png) [@matheusribeirogarcia](https://discuss.elastic.co/u/matheusribeirogarcia)\
**Post date:** [May 20, 2019, 3:47pm UTC](https://discuss.elastic.co/t/how-to-index-multiple-fields-receiving-an-array/181866/1 "2019-05-20T15:47:27Z")

</div>

I've tried to index it like this:

```
   body: {
            name: form.value.name,
            title: form.value.title,
            description: form.value.description,
            published: new Date().toLocaleString(),
            stash: {
              "title": this.alternativeFields.value,
              "type": "object",
              "dynamic": true
            }
          }

```

Basically `this.alternativeFields.value` is an array that contains, for example:

> ["field1", "field2", "field3"]

And for every position of that array I want to create a field in the elastic document.

Is there a way to do that?

---

<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:** [June 17, 2019, 3:47pm UTC](https://discuss.elastic.co/t/how-to-index-multiple-fields-receiving-an-array/181866/2 "2019-06-17T15:47:33Z")

</div>

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