Skip to content

Instantly share code, notes, and snippets.

@slixurd
Created June 25, 2016 11:23
Show Gist options
  • Save slixurd/7b91056b5fe6ff891f162570a49de5bc to your computer and use it in GitHub Desktop.
Save slixurd/7b91056b5fe6ff891f162570a49de5bc to your computer and use it in GitHub Desktop.
PUT /term_test
{
"settings": {
"index": {
"number_of_shards": 2,
"number_of_replicas": 0
}
},
"mappings": {
"item": {
"properties": {
"name" : {
"type" : "string"
},
"tags": {
"type": "string",
"index": "not_analyzed"
},
"id":{
"type": "long"
}
}
}
}
}
POST /term_test/item/2
{
"id": 1,
"name": "XXX",
"tags": [
"无文字",
"恋爱",
"冒险"
]
}
POST /term_test/item/1
{
"id": 1,
"name": "XXX",
"tags": [
"文字",
"恋爱",
"冒险"
]
}
POST /term_test/item/3
{
"id": 1,
"name": "XXX",
"tags": [
"A 文字",
"恋爱",
"冒险"
]
}
POST /term_test/_search
{
"query": {
"term": {
"tags": {
"value": "文字"
}
}
}
}
@nadoo
Copy link

nadoo commented Jun 28, 2016

请问上面这些测试的内容,有什么工具可以拷贝进去直接执行吗?

@wangxiuwen
Copy link

curl -XPOST /term_test/_search -d '{"query": {"term": {"tags": {"value": "文字"}}}}'

@zhmz1326
Copy link

在Kibana上可以直接执行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment