试试搜索一下吧

请教使用curl的查询结果不对,但head能正确查询

匿名 | 发布于2017年07月10日 | 阅读数:7725

curl -XPUT http://localhost:9200/medcl-d -d '
{
"index": {
"analysis": {
"analyzer": {
"pinyin_analyzer": {
"tokenizer": "my_pinyin"
}
},
"tokenizer": {
"my_pinyin": {
"type": "pinyin",
"keep_first_letter": false,
"keep_separate_first_letter": true,
"keep_full_pinyin": false,
"keep_original": false,
"limit_first_letter_length": 16,
"lowercase": true
}
}
}
}
}'

curl -XPOST http://localhost:9200/medcl-d/folks/andy -d'
{"name":"刘德华"}'

curl -XGET http://localhost:9200/medcl-d/folks/_search?pretty -d '
{
"query": {
"match_phrase": {
"name.pinyin": "dh"
}
}
}'
curl.png head.png
已邀请:

wengqiankun - es新手

赞同来自:

你这应该是post操作吧

gzliudan

赞同来自:

是get操作没错,如果换成post,就连head也查询不出数据
匿名用户

匿名用户

赞同来自:

问题已经解决,原因是未定义mapping、只定义了分词器

要回复问题请先登录注册