{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 1,
"analysis": {
"analyzer": {
"ik": {
"tokenizer": "ik_max_word"
}
}
}
},
"mappings": {
"person": {
"properties": {
"birthday": {
"type": "date"
},
"score": {
"type": "double"
},
"profile": {
"type": "text",
"analyzer": "ik",
"search_analyzer": "ik_max_word"
},
"name": {
"type": "string",
"index": "not_analyzed"
},
"id": {
"type": "long"
},
"married": {
"type": "boolean"
},
"age": {
"type": "long"
},
"@timestamp": {
"format": "strict_date_optional_time||epoch_millis",
"type": "date"
}
}
}
}
}
{
"query": {
"match_phrase": {
"profile": "政治"
}
},
"highlight": {
"pre_tags": [
"<font size=\"5\" face=\"arial\" color=\"red\">"
],
"post_tags": [
"</font>"
],
"fields": {
"profile": {}
}
}
}
查询1
_search
post
{"query":{"bool":{"must":[{"match_all":{}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"aggs":{}}
查询2
插入
url:http://localhost:9200/song001/list001/5
data:{"number":32768,"singer":"杨坤","size":"777","song":"今夜20岁","tag":"中国好声音","timelen":319}
put
更新
删除