# Re-indexing into schema with new multifields

**URL:** <https://discuss.elastic.co/t/re-indexing-into-schema-with-new-multifields/297203>\
**Category:** Elasticsearch\
**Created:** [February 15, 2022, 12:08am UTC](https://discuss.elastic.co/t/re-indexing-into-schema-with-new-multifields/297203 "2022-02-15T00:08:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Gatihi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_gatihi/32/25820_2.png) [@Chris\_Gatihi](https://discuss.elastic.co/u/Chris_Gatihi)\
**Post date:** [February 15, 2022, 12:08am UTC](https://discuss.elastic.co/t/re-indexing-into-schema-with-new-multifields/297203/1 "2022-02-15T00:08:12Z")

</div>

Hi,

Let's say, for the sake of simplicity, I have an index "a" with only this field in the schema:

```auto
 "foo": {
                "type": "keyword",
              }

```

And then I create a new index "b" with a new _multifield_ added to the schema because I want to be able to tokenize on the same field and run free text queries against it:

```auto
 "foo": {
                "type": "keyword",
                "fields" : {
                  "search": {
                    "type": "text",
                    "analyzer" : "standard"
                  }
                }
              }

```

If I then do a simple re-index as follows:

```auto
POST _reindex
{
  "source": {
    "index": "a"
  },
  "dest": {
    "index": "b"
  }
}

```

Will index "b" have "foo.search" populated with the analyzed tokens by default? The reason I ask is because on the one hand I would expect it to. But then I see this in the docs for the "reindex" API:

> The most basic form of `_reindex` just copies documents from one index to another. This will copy documents from the `twitter` index into the `new_twitter` index

"copy" sounds like "b" will have the exact same thing as "a" had prior to the operation, without adding anything new to the "search" multifield in this case.

From my observations on my data after re-indexing, it looks like "b" doesn't have the new analyzed tokens for the "foo.search" field apart from subsequently indexing a document explicitly against the "b" index (e.g. via a call to `POST /b/_doc/`).

What is the expected/designed Elasticsearch behavior?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 15, 2022, 1:22am UTC](https://discuss.elastic.co/t/re-indexing-into-schema-with-new-multifields/297203/2 "2022-02-15T01:22:24Z")

</div>

"The most basic form" implies that you aren't doing any mapping changes. Given you have a new mapping defined with extra fields, the index process will respect that and populate those fields for you.

---

<div class="post-metadata">

**Author:** ![Chris\_Gatihi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_gatihi/32/25820_2.png) [@Chris\_Gatihi](https://discuss.elastic.co/u/Chris_Gatihi)\
**Post date:** [February 16, 2022, 1:32am UTC](https://discuss.elastic.co/t/re-indexing-into-schema-with-new-multifields/297203/3 "2022-02-16T01:32:33Z")

</div>

Thank you for confirming.

---

<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:** [March 16, 2022, 1:32am UTC](https://discuss.elastic.co/t/re-indexing-into-schema-with-new-multifields/297203/4 "2022-03-16T01:32:55Z")

</div>

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