# Using special characters to search the text that is contained \\n character

**URL:** <https://discuss.elastic.co/t/using-special-characters-to-search-the-text-that-is-contained-n-character/83653>\
**Category:** Elasticsearch\
**Created:** [April 26, 2017, 6:27am UTC](https://discuss.elastic.co/t/using-special-characters-to-search-the-text-that-is-contained-n-character/83653 "2017-04-26T06:27:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce\_lo](https://avatars.discourse-cdn.com/v4/letter/b/ac8455/32.png) [@bruce\_lo](https://discuss.elastic.co/u/bruce_lo)\
**Post date:** [April 26, 2017, 6:27am UTC](https://discuss.elastic.co/t/using-special-characters-to-search-the-text-that-is-contained-n-character/83653/1 "2017-04-26T06:27:05Z")

</div>

I using `(**&(&A` search the text with plugin smartcn, then it can search the result.  
But my wish is it doesn't show the result when using this query. Is there any solutions? Thanks.

my index, type:

```auto
curl -XPUT 'http://localhost:9200/kkk?pretty' -d '{
    "mappings":{
        "ddd":{
            "properties":{
                "publish_content":{
                    "type": "text",
                    "analyzer": "smartcn"
                }
            }
        }
    }
}'

```

the text:

```auto
curl -XPUT 'localhost:9200/kkk/ddd/1?pretty&pretty' -H 'Content-Type: application/json' -d'
{
  "publish_content": "12.27日晚上差不多8点多左右，一对夫妇就过来了，说想换台手机。\n\nA\n听说xxx上市了？那xxx大的那个什么时候上市？\n\nB\n这个是这个月底30号上市。"
}
'

```

search:

```auto
curl -XPOST 'http://localhost:9200/kkk/ddd/_search?pretty' -d '{
  "query": {
    "bool": {
      "must": [
        {
          "match_phrase": {
            "publish_content": {
              "query": "(**&(&A",
              "analyzer" : "smartcn"
            }
          }
        }
      ]
    }
  }
}'

```

it will show reuslt:

```auto
{
  "took" : 17,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 0.23398489,
    "hits" : [
      {
        "_index" : "kkk",
        "_type" : "ddd",
        "_id" : "1",
        "_score" : 0.23398489,
        "_source" : {
          "publish_content" : "12.27日晚上差不多8点多左右，一对夫妇就过来了，说想换台手机。\n\nA\n听说xxx上市了？那xxx大的那个什么时候上市？\n\nB\n这个是这个月底30号上市。"
        }
      }
    ]
  }
}

```

---

<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:** [May 24, 2017, 6:36am UTC](https://discuss.elastic.co/t/using-special-characters-to-search-the-text-that-is-contained-n-character/83653/2 "2017-05-24T06:36:02Z")

</div>

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