When query with json contain unicode dose not work?


(zhouxiang) #1

{"term":{"kind":"nps\u51c0\u63a8\u8350\u503c"}}
find nothing

{"term":{"kind":"nps推荐指数"}}
get the result


(Igor Motov) #2

I can think of a couple of possible reasons for that.

  1. Symbol "" is treated as a an escape symbol on your command line and is
    not getting passed properly to json.
  2. You index doesn't contain 净推荐值 (that's what \u51c0\u63a8\u8350\u503c
    represents)

On Tuesday, May 15, 2012 2:34:44 AM UTC-4, shinezhou wrote:

{"term":{"kind":"nps\u51c0\u63a8\u8350\u503c"}}
find nothing

{"term":{"kind":"nps推荐指数"}}
get the result

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/when-query-with-json-contain-unicode-dose-not-work-tp3987522.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(zhouxiang) #3

but {"term":{"kind":"nps推荐指数"}} can work.


(Igor Motov) #4

Does {"term":{"kind":"nps净推荐值"}} find anything?

On Tuesday, May 15, 2012 9:05:06 PM UTC-4, shinezhou wrote:

but {"term":{"kind":"nps推荐指数"}} can work.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/when-query-with-json-contain-unicode-dose-not-work-tp3987522p3992934.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(medcl.net) #5

{"term":{"kind":"nps推荐指数"}} is right,you doesn't need to encode your
keyword,except your indexed data is unicoded like
that:":{"kind":"nps\u51c0\u63a8\u8350\u503c"

-----Original Message-----
From: zhouxiang
Sent: Wednesday, May 16, 2012 9:05 AM
To: elasticsearch@googlegroups.com
Subject: Re: when query with json contain unicode dose not work?

but {"term":{"kind":"nps推荐指数"}} can work.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/when-query-with-json-contain-unicode-dose-not-work-tp3987522p3992934.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #6