枣阳网站开发公司哪家好,广州模板建站软件,根路径 网站,广告传媒公司简介es 7.0常用的命令
es 7.0中只有索引和文档(document)#xff0c;没有类型(type)了。
es新建索引#xff1a;
格式#xff1a;
PUT /索引名称
{mappings:{properties:{字段名称:{type:字段类型}}}
}PUT 加索…es 7.0常用的命令
es 7.0中只有索引和文档(document)没有类型(type)了。
es新建索引
格式
PUT /索引名称
{mappings:{properties:{字段名称:{type:字段类型}}}
}PUT 加索引名称 比如以下的 PUT /book_2023_09
type 表示字段类型。id、order_no 这些是字段名。
示例
PUT /book_2023_09
{mappings:{properties:{id:{type:long},order_no:{type:text},name:{type:keyword},create_date:{type:date}}}
}es 查询索引的字段结构/数据结构
GET /索引名称/_mappinges 查询索引下面文档数量
GET /索引名称/_countes 添加/更新别名
PUT /索引名称/_alias/别名名称es 查询别名
GET /索引名称/_aliases 新增文档
POST /索引名称/_doc示例
POST /book_2020_09/_doc
{name: wu,create_date: 2020-10-24,order_no: 082313sfsd1,id: 10823131
}es 根据条件查询文档
GET /book_2020_09/_search详细的 查询见 https://www.cnblogs.com/expiator/p/13843957.html
es 根据_id查询文档
GET /索引名称/_doc/文档的_id注意是 _search返回结果中的 _id 而不是文档中的字段id。