我在 Elasticsearch 中有一个字段,其值为"ft:05/08/2015 13:01:27.358,cgn:4189"
。
当我想使用查询字符串“cgn:4189”进行搜索时,我没有结果。
我尝试像“cgn:4189”一样转义冒号,但有语法错误。
我不知道该怎么做。
{"query":{"bool":{"must":[{"query_string":{"default_field":"fluentd.message","query":"cgn:"}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"facets":{}}
结果 :
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures
And
{"query":{"bool":{"must":[{"query_string":{"default_field":"fluentd.message","query":"cgn\:"}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"facets":{}}
结果 :
JSON.parse: bad escaped character at line 1 column 91 of the JSON data
你能帮我吗?