Open Draymonders opened 3 years ago
es 底层基于 Lucene 实现分布式检索, Lucene主要是做分词处理(有各种分词器)
https://www.elastic.co/guide/cn/elasticsearch/guide/current/foreword_id.html
如下创建blog的索引
blog
PUT blog { "settings": { "number_of_replicas": 1, "number_of_shards": 2 } }
查看索引的配置
GET blog/_settings
新建文档
PUT blog/_create/1 { "id": 1, "title": "just a title", "create-time": "2021-05-16", "content": "测试es新建文档" }
查看文档
GET blog/_doc/1
全文检索,按照相关性倒序排列
GET blog/_search { "query": { "match": { "title": "just" } } }
高亮操作
GET blog/_search { "query": { "match_phrase_prefix": { "title": "just" } }, "highlight": { "fields": { "title": {} } } }
简介
es 底层基于 Lucene 实现分布式检索, Lucene主要是做分词处理(有各种分词器)
https://www.elastic.co/guide/cn/elasticsearch/guide/current/foreword_id.html
索引
创建索引
如下创建
blog
的索引查看索引的配置
文档
新建文档
查看文档
检索
全文检索,按照相关性倒序排列
高亮操作