# Elastic search term support chinese character?

**URL:** <https://discuss.elastic.co/t/elastic-search-term-support-chinese-character/13795>\
**Category:** Elasticsearch\
**Created:** [September 28, 2013, 7:50am UTC](https://discuss.elastic.co/t/elastic-search-term-support-chinese-character/13795 "2013-09-28T07:50:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrilforce](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cyrilforce](https://discuss.elastic.co/u/cyrilforce)\
**Post date:** [September 28, 2013, 7:50am UTC](https://discuss.elastic.co/t/elastic-search-term-support-chinese-character/13795/1 "2013-09-28T07:50:09Z")

</div>

Hi All,

I m trying to use term query to do full text search with combination of  
english and chinese character but it returned me empty records.

\*Documents in the index : \*

"\_source": {  
"user": "kimchy",  
"post\_date": "2009-11-15T14:12:12",  
"message": "trying out Elastic Search"  
}

"\_source": {  
"user": "kimchy",  
"post\_date": "2009-11-15T14:12:12",  
\* "message": "trying 汉字漢字 "\*  
}

"\_source": {  
"user": "kimchy",  
"post\_date": "2009-11-15T14:12:12",  
\* "message": "trying汉字漢字 "\*  
}

\*The index mapping : \*

{  
"tweet": {  
"properties": {  
\* "message": {\*

- 

```
           "type": "string",*

```

- 

```
           "index": "not_analyzed",*

```

- 

```
           "omit_norms": true,*

```

- 

```
           "index_options": "docs"*

```

- 

```
       },*
      "post_date": {
          "type": "date",
          "format": "dateOptionalTime"
      },
      "user": {
          "type": "string"
      }
  }

```

}  
}

\*The query tested : \*

1 )

{  
"query" : {  
"term" : { "message" : "trying汉字漢字" }  
}  
}

_Result : Empty record_

1. 

{  
"query" : {  
"term" : { "message" : "trying 汉字漢字" }  
}  
}

_Result : Empty record_  
\*  
\*  
\*  
\*  
3.

{  
"query" : {  
"term" : { "message" : "trying out Elastic Search" }  
}  
}  
_Result : One record_

My expected result is when i passed in "trying 汉字漢字" in the term query it  
should return me the documents that have "trying 汉字漢字" (exact word match).

Any idea ? Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [September 28, 2013, 2:46pm UTC](https://discuss.elastic.co/t/elastic-search-term-support-chinese-character/13795/2 "2013-09-28T14:46:33Z")

</div>

Hi,

Your documents with chinese character in E-mail include two blank at the last of message string.

I try to index following documents, then your 3 query return one record each query.

1.-----

{  
"\_index": "test",  
"\_type": "tweet",  
"\_id": "1",  
"\_version": 1,  
"exists": true,  
"\_source": {  
"user": "kimchy",  
"post\_date": "2009-11-15T14:12:12",  
"message": "trying out Elastic Search"  
}  
}

2.-----  
{  
"\_index": "test",  
"\_type": "tweet",  
"\_id": "2",  
"\_version": 1,  
"exists": true,  
"\_source": {  
"user": "kimchy",  
"post\_date": "2009-11-15T14:12:12",  
"message": "trying 汉字漢字"  
}  
}

3.-----  
{  
"\_index": "test",  
"\_type": "tweet",  
"\_id": "3",  
"\_version": 1,  
"exists": true,  
"\_source": {  
"user": "kimchy",  
"post\_date": "2009-11-15T14:12:12",  
"message": "trying汉字漢字"  
}  
}

* * *

Jun Ohtani  
[johtani@gmail.com](mailto:johtani@gmail.com)  
blog : [http://blog.johtani.info](http://blog.johtani.info)  
twitter : [http://twitter.com/johtani](http://twitter.com/johtani)

On 2013/09/28, at 16:50, cyrilforce [cheehoo84@gmail.com](mailto:cheehoo84@gmail.com) wrote:

> Hi All,
> 
> I m trying to use term query to do full text search with combination of english and chinese character but it returned me empty records.
> 
> Documents in the index :
> 
> "\_source": {  
> "user": "kimchy",  
> "post\_date": "2009-11-15T14:12:12",  
> "message": "trying out Elastic Search"  
> }
> 
> "\_source": {  
> "user": "kimchy",  
> "post\_date": "2009-11-15T14:12:12",  
> "message": "trying 汉字漢字 "  
> }
> 
> "\_source": {  
> "user": "kimchy",  
> "post\_date": "2009-11-15T14:12:12",  
> "message": "trying汉字漢字 "  
> }
> 
> The index mapping :
> 
> {  
> "tweet": {  
> "properties": {  
> "message": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> "index\_options": "docs"  
> },  
> "post\_date": {  
> "type": "date",  
> "format": "dateOptionalTime"  
> },  
> "user": {  
> "type": "string"  
> }  
> }  
> }  
> }
> 
> The query tested :
> 
> 1 )
> 
> {  
> "query" : {  
> "term" : { "message" : "trying汉字漢字" }  
> }  
> }
> 
> Result : Empty record
> 
> 1. 
> 
> {  
> "query" : {  
> "term" : { "message" : "trying 汉字漢字" }  
> }  
> }
> 
> Result : Empty record
> 
> 1. 
> 
> {  
> "query" : {  
> "term" : { "message" : "trying out Elastic Search" }  
> }  
> }  
> Result : One record
> 
> My expected result is when i passed in "trying 汉字漢字" in the term query it should return me the documents that have "trying 汉字漢字" (exact word match).
> 
> Any idea ? Thanks.
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:14am UTC](https://discuss.elastic.co/t/elastic-search-term-support-chinese-character/13795/3 "2017-07-06T02:14:19Z")

</div>


