简介
官方文档:https://www.elastic.co/guide/cn/elasticsearch/guide/current/index-doc.html
类比mysql数据库:
索引-数据库
类型-表
文档-记录
属性-字段

PUT /megacorp/employee/2
{
"first_name" : "Jane",
"last_name" : "Smith",
"age" : 32,
"about" : "I like to collect rock albums",
"interests": [ "music" ]
}
此请求将在索引megacorp的employee类型中存储一个文档。标识1
put请求是insert和update
get请求是查询
delete请求是删除
head请求是检查是否有指定文档
。。。更详细的使用在官方文档更全面。
安装
docker安装参考:https://blog.youkuaiyun.com/dimandsun/article/details/103273606#elasticsearch_157
windows安装:
官网下载后,执行bin/elasticsearch.bat即可轻松使用
http://127.0.0.1:9200/
springboot使用
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
本文详细介绍Elasticsearch的安装与Spring Boot集成方法,包括通过Docker和Windows安装过程,以及如何在Spring Boot项目中引入依赖进行操作。从创建索引到文档的增删改查,深入浅出地讲解Elasticsearch的基础用法。

被折叠的 条评论
为什么被折叠?



