# Error in Re-Index Documentation

**URL:** <https://discuss.elastic.co/t/error-in-re-index-documentation/114668>\
**Category:** Elasticsearch\
**Created:** [January 9, 2018, 9:01am UTC](https://discuss.elastic.co/t/error-in-re-index-documentation/114668 "2018-01-09T09:01:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [January 9, 2018, 9:01am UTC](https://discuss.elastic.co/t/error-in-re-index-documentation/114668/1 "2018-01-09T09:01:46Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types.html)

The script example here is apparently incorrect. ES does not accept the triple quotes.

As far as I can see it should be single quotes with the script all on one line.

```
"script": {
    "source": "ctx._source.type = ctx._type;ctx._id = ctx._type + '-' + ctx._id;ctx._type = 'doc';"
  }
```

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [January 9, 2018, 9:34am UTC](https://discuss.elastic.co/t/error-in-re-index-documentation/114668/2 "2018-01-09T09:34:38Z")

</div>

The documentation is generally written in the syntax accepted by Kibana Console (formally known as Sense). Kibana Console accepts scripts surrounded by triple double-quotes so you can write scripts that span multiple lines so they are easier to read. Console flattens these scripts to a single line and replaces the triple double-quotes with single double-quotes when it sends the request to Elasticsearch. If you are sending requests from outside of Console then you are right that you need to use single double-quotes and the script needs to be on one line.

---

<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:** [February 6, 2018, 9:35am UTC](https://discuss.elastic.co/t/error-in-re-index-documentation/114668/3 "2018-02-06T09:35:03Z")

</div>

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