# Indexing \\n as \\n in elasticsearch

**URL:** <https://discuss.elastic.co/t/indexing-n-as-n-in-elasticsearch/107415>\
**Category:** Elasticsearch\
**Created:** [November 13, 2017, 3:29pm UTC](https://discuss.elastic.co/t/indexing-n-as-n-in-elasticsearch/107415 "2017-11-13T15:29:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabali12345](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kabali12345](https://discuss.elastic.co/u/kabali12345)\
**Post date:** [November 13, 2017, 3:29pm UTC](https://discuss.elastic.co/t/indexing-n-as-n-in-elasticsearch/107415/1 "2017-11-13T15:29:00Z")

</div>

Hi all.....

Here i am trying to index \n as a field values in elasticsearch  
here is my mapping

```auto
PUT my_index
{
  "mappings": {
    "my_type": {
      "properties": {
        "city": {
          "type": "text"
          
        }
      }
    }
  }
}

```

and i am using kibana devtool for indexing document into it

```auto
PUT my_index/my_type/1
{
  "city": "\ntomorrow"
}

```

but i kibana i am seeing field value like **city: tomorrow**  
but i want it to store as it is **city:\ntomorrow**  
how can i do that ?  
similarly i am trying to index new document something like this

```auto
PUT my_index/my_type/2
{
  "city": "\Xtomorrow"
}

```

above query gives me error something like this

```auto
 {
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse [city]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse [city]",
    "caused_by": {
      "type": "i_o_exception",
      "reason": "Unrecognized character escape 'X' (code 88)\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@5874096a; line: 2, column: 14]"
    }
  },
  "status": 400
}

```

but in this case also i want elasticsearch to store city values as **city:\Xtomorrow**.  
how can i do that.

Thank You.

---

<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:** [December 11, 2017, 3:29pm UTC](https://discuss.elastic.co/t/indexing-n-as-n-in-elasticsearch/107415/2 "2017-12-11T15:29:03Z")

</div>

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