GET /persondocument/_search
{
"_source": ["name"],
"query": {
"wildcard": {"name":{"value": "888*"}}
}
}
#查询所有索引库
GET _cat/indices
#查看persondocument表结构
GET /persondocument/_mapping/
#创建索引
PUT my_index
{
"mappings": {
"properties": {
"name": {
"type": "keyword"
}
}
}
}
GET /my_index/_mapping/
GET /km_doc/_mapping
#查询所有记录,返回fileNo
GET /km_doc/_search
{
"_source": ["fileNo"],
"query" :{
"match_all":{}
}
}
#es中text和keyword的区别
#text
# 会分词,然后索引
# 支持模糊,精确搜索
# 不支持聚合
#keyword
# 直接索引
# 支持模糊,精确搜索
# 支持聚合
#按fileNo分组查询
GET /km_doc/_search
{
"_source": ["fileNo"],
"aggregations": {
"ABC": {
"terms": {
"field": "fileNo"
}
}
}
}
kibana es操作
最新推荐文章于 2023-05-20 23:34:27 发布