# Analyze with smartcn get messy code

**URL:** <https://discuss.elastic.co/t/analyze-with-smartcn-get-messy-code/68569>\
**Category:** Elasticsearch\
**Created:** [December 9, 2016, 1:37pm UTC](https://discuss.elastic.co/t/analyze-with-smartcn-get-messy-code/68569 "2016-12-09T13:37:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roro\_codeath](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@roro\_codeath](https://discuss.elastic.co/u/roro_codeath)\
**Post date:** [December 9, 2016, 1:37pm UTC](https://discuss.elastic.co/t/analyze-with-smartcn-get-messy-code/68569/1 "2016-12-09T13:37:02Z")

</div>

here is full steps, how to make response tokens are Chinese not messy code

```auto
curl -XDELETE localhost:9200/test_chinese
{"acknowledged":true}

roroco@roroco ~/Dropbox/rbcurl -XPUT localhost:9200/test_chinese -d '{
> "settings": {
> "index": {
> "analysis": {
> "analyzer": {
> "default": {
> "type": "smartcn"
> }
> }
> }
> }
> }
> }'
{"acknowledged":true,"shards_acknowledged":true}

roroco@roroco ~/Dropbox/rbs/ro_elasticsearch $ curl localhost:9200/test_chinese/_analyze?text='这个不错'
{"tokens":[{"token":"￨","start_offset":0,"end_offset":1,"type":"word","position":0},{"token":"﾿","start_offset":1,"end_offset":2,"type":"word","position":1},{"token":"ﾙ","start_offset":2,"end_offset":3,"type":"word","position":2},{"token":"￤","start_offset":3,"end_offset":4,"type":"word","position":3},{"token":"ﾸ","start_offset":4,"end_offset":5,"type":"word","position":4},{"token":"ﾪ","start_offset":5,"end_offset":6,"type":"word","position":5},{"token":"￤","start_offset":6,"end_offset":7,"type":"word","position":6},{"token":"ﾸ","start_offset":7,"end_offset":8,"type":"word","position":7},{"token":"ﾍ","start_offset":8,"end_offset":9,"type":"word","position":8},{"token":"￩","start_offset":9,"end_offset":10,"type":"word","position":9},{"token":"ﾔ","start_offset":10,"end_offset":11,"type":"word","position":10},{"token":"ﾙ","start_offset":11,"end_offset":12,"type":"word","position":11}]}roroco@roroco ~/Dropbox/rbs/ro_elasticsearch $

```

---

<div class="post-metadata">

**Author:** ![roro\_codeath](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@roro\_codeath](https://discuss.elastic.co/u/roro_codeath)\
**Post date:** [December 9, 2016, 2:01pm UTC](https://discuss.elastic.co/t/analyze-with-smartcn-get-messy-code/68569/2 "2016-12-09T14:01:44Z")

</div>

I find the solution, even &text=很不错 doesn't work, I can use text field in body instead:

curl localhost:9200/test\_chinese/\_analyze?analyzer=smartcn -d '{"text": "很不错"}'

```auto
roroco@roroco ~/Dropbox/rbs/ro_elasticsearch $ curl localhost:9200/test_chinese/_analyze?analyzer=smartcn -d '{"text": "很不错"}'
{"tokens":[{"token":"很","start_offset":0,"end_offset":1,"type":"word","position":0},{"token":"不错","start_offset":1,"end_offset":3,"type":"word","position":1}]}

```

---

<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:** [January 6, 2017, 2:02pm UTC](https://discuss.elastic.co/t/analyze-with-smartcn-get-messy-code/68569/3 "2017-01-06T14:02:22Z")

</div>

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