搜索引擎Elasticsearch+es-mysql同步+ik分词
Elasticsearch
Elasticsearch是一个搜索引擎,我个人认为可以理解为是数据库,如下图:
普通数据库 | 搜索引擎Elasticsearch |
---|---|
数据库 | 索引index |
表 | 类型type |
行 | 文档document |
常用操作
-
PUT:创建索引
注意:索引名不能出现大写
-
POST:增加文档
http://localhost:9200/索引名/类型名
{
文档… 例如:
“title”:“mytitle”,
“content”:“mycontent…”
}
POST请求成功的 created为true
PUT请求成功的 created为false</