1、设计 表
put方法 127.0.0.1:9200/index_mapping
{
"mappings":{
"properties": {
"realname":{
"type":"text",
"index":true
},
"username":{
"type":"keyword",
"index":false
}
}
}
}
2、_anaylze
get 方法 127.0.0.1:9200/index_mapping/_analyze
{
"field": "realname",
"text":"imooc is very good"
}
上述是一个一个词分开。
修改如下,就是一整段了。 keyword 因为
{
"field": "username",
"text":"imooc is very good"
}
3、增加两个表的字段设计
post 方法 127.0.0.1:9200/index_mapping/_mapping
{
"properties": {
"id":{
"type":"long",
"index":true
},
"age":{
"type":"integer",
"index":false
}
}
}
四、其他 字段
{
"properties": {
"money1":{
"type":"float"
},
"money2":{
"type":"double"
}
}
}
{
"properties": {
"sex":{
"type":"byte"
},
"score":{
"type":"short"
}
}
}
{
"properties": {
"is_teenger": {
"type": "boolean"
},
"birthday": {
"type": "date"
},
"relationship": {
"type": "object"
}
}
}