es

 

 

 

 

 

-------------------------------------

 

-----------------------------------------------------------------增删改查

#! Deprecation: [types removal] Specifying types in document index requests is deprecated, use the typeless endpoints instead (/{index}/_doc/{id}, /{index}/_doc, or /{index}/_create/{id}).
{
"_index" : "test1",
"_type" : "type1",
"_id" : "1",                          ->这个是id
"_version" : 1,                        ->当前没有被更新过
"result" : "created",                      ->crated状态
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1
}

 

 

 

数据类型es的 keyword是不可分割的 

 

 

 

 

 

 

 查看默认类型 put命令

 

 

 

 查看集群信息, 健康值

 

 

 

 post风格修改索引

 

 

 

 

 修改推荐用post update

 

 

 

 精确匹配

GET /kuangshen/_search
{
"query": {
"match": {
"name": "子昱"
}
}
}

 

 hits的作用

 

 查询的结果的过滤 数组需要[]

 

 

排序命令   

GET /kuangshen/_search
{
"query": {
"match": {
"name": "子昱"
}
},
"_source": ["name","desc"]
,
"sort": [
{
"age": {
"order": "desc"
}
}
]
}

 

 

 判断从哪里开始,每页多少数据

 

 bool查询,必须带xx条件,再must数组[]里面用{}分隔开,逗号链接

GET /kuangshen/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"name": "子昱说"
}
},
{
"match": {
"age": 19
}
}
]
}
}
}

 

 -----------------------------------------------------------------

or shoule查询

 

 not 查询不是xx的人    must_not 

 

 过滤器filter lt就是小于 lte就是小于等于

 

 

 

 

 

 

 结果权重对比

 

 -----------------------------------------------------

如果用keyword就是整体查找

默认就用分词器

 

 

 

 

 

 

trem精确查询多个值 

 

 高亮显示

 

 

 

 

posted @ 2022-06-03 19:59  lamda表达式先驱  阅读(145)  评论(0)    收藏  举报