Elasticsearch示例
Elasticsearch基础
- • Elasticsearch的定义与作用
- • Elasticsearch的基本组成
- • Elasticsearch的工作流程
Elasticsearch示例
# 创建索引
PUT /my_index
{
"mappings": {
"properties": {
"title": { "type": "text" },
"content": { "type": "text" }
}
}
}
# 搜索文档
GET /my_index/_search
{
"query": {
"match": {
"content": "搜索关键词"
}
}
}