# Error reindexing "Field \[\_source\] is defined both as an object and a field."

**URL:** <https://discuss.elastic.co/t/error-reindexing-field-source-is-defined-both-as-an-object-and-a-field/224518>\
**Category:** Elasticsearch\
**Created:** [March 21, 2020, 12:18pm UTC](https://discuss.elastic.co/t/error-reindexing-field-source-is-defined-both-as-an-object-and-a-field/224518 "2020-03-21T12:18:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sidgate/32/47498_2.png) [@sidgate](https://discuss.elastic.co/u/sidgate)\
**Post date:** [March 21, 2020, 12:18pm UTC](https://discuss.elastic.co/t/error-reindexing-field-source-is-defined-both-as-an-object-and-a-field/224518/1 "2020-03-21T12:18:02Z")

</div>

I am trying to copy existing index to new index using reindex API

```auto
/_reindex?wait_for_completion=false
{
    "source": {
    "index": "articles"
    },
    "dest": {
    "index": "articles20200321"
    },
    "conflicts": "proceed"
}

```

But it fails after some time with following error

```auto
"failures": [
    {
        "index": "articles20200321",
        "type": "_doc",
        "id": "_analyze",
        "cause": {
            "type": "illegal_argument_exception",
            "reason": "Field [_source] is defined both as an object and a field."
        },
        "status": 400
    }
]

```

There are around 783907 documents and only 126999 get created to new index. Can someone please point to the root cause, or how to identify it?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 21, 2020, 1:19pm UTC](https://discuss.elastic.co/t/error-reindexing-field-source-is-defined-both-as-an-object-and-a-field/224518/2 "2020-03-21T13:19:01Z")

</div>

Apparently you have a document which `_id` is `_analyze`. It looks weird.

---

<div class="post-metadata">

**Author:** ![sidgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sidgate/32/47498_2.png) [@sidgate](https://discuss.elastic.co/u/sidgate)\
**Post date:** [March 21, 2020, 2:54pm UTC](https://discuss.elastic.co/t/error-reindexing-field-source-is-defined-both-as-an-object-and-a-field/224518/3 "2020-03-21T14:54:42Z")

</div>

Thanks, that was helpful. After deleting the document with id `_analyze` I was able to successfully reindex.

Seems this document was created by mistake while executing incorrect analyze request.

---

<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:** [April 18, 2020, 2:54pm UTC](https://discuss.elastic.co/t/error-reindexing-field-source-is-defined-both-as-an-object-and-a-field/224518/4 "2020-04-18T14:54:44Z")

</div>

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