数据类型
{
"properties": {
"name": {
"type": "text"
},
"team_name": {
"type": "text"
},
"position": {
"type": "text"
},
"play_year": {
"type": "long"
},
"jerse_no": {
"type": "keyword"
},
"title": {
"type": "text"
},
"date": {
"type": "date"
}
}
}
{
"name": "蔡x坤",
"team_name": "勇⼠",
"position": "得分后卫",
"play_year": 10,
"jerse_no": "31",
"title": "打球最帅的明星",
"date":"2020-01-01"
}
{
"name": "杨超越",
"team_name": "猴急",
"position": "得分后卫",
"play_year": 10,
"jerse_no": "32",
"title": "打球最可爱的明星",
"date":1610350870
}
{
"name": "吴亦凡",
"team_name": "湖⼈",
"position": "得分后卫",
"play_year": 10,
"jerse_no": "33",
"title": "最会说唱的明星",
"date":1641886870000
}
{
"name": "吴亦凡",
"team_name": "湖⼈",
"position": "得分后卫",
"play_year": 10,
"jerse_no": "33",
"title": "最会说唱的明星",
"date": "1641886870",
"array": [
"one",
"two"
],
"address": {
"region": "China",
"location": {
"province": "GuangDong",
"city": "GuangZhou"
}
}
}
"address.region": "China",
"address.location.province": "GuangDong",
"address.location.city": "GuangZhou"
{
"query": {
"match": {
"address.region": "china"
}
}
}
POST localhost:9200/nba/_mapping
{
"properties": {
"name": {
"type": "text"
},
"team_name": {
"type": "text"
},
"position": {
"type": "text"
},
"play_year": {
"type": "long"
},
"jerse_no": {
"type": "keyword"
},
"title": {
"type": "text"
},
"date": {
"type": "date"
},
"ip_addr": {
"type": "ip"
}
}
}
PUT localhost:9200/nba/_doc/9
{
"name": "吴亦凡",
"team_name": "湖⼈",
"position": "得分后卫",
"play_year": 10,
"jerse_no": "33",
"title": "最会说唱的明星",
"ip_addr": "192.168.1.1"
}
POST localhost:9200/nba/_search
{
"query": {
"term": {
"ip_addr": "192.168.0.0/16" //
192.168 .0 .0~192.168 .255 .255)
}
}