ElasticSearch学习笔记-邻近匹配搜索记录

(4) 2024-06-16 08:23

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说
ElasticSearch学习笔记-邻近匹配搜索记录,希望能够帮助你!!!。

ElasticSearch版本:elasticsearch-7.3.0

环境准备:

curl -H "Content-Type: application/json" -XPUT 'http://192.168.0.1:9200/article/' -d ' { "settings": { "analysis": { "analyzer": { "shingle_analyzer": { "type": "custom", "tokenizer": "ik_smart", "filter": [ "shingle_filter" ] } }, "filter": { "shingle_filter": { "type": "shingle", "min_shingle_size": 2, "max_shingle_size": 4, "output_unigrams": false } } } }, "mappings": { "dynamic": "strict", "_source": { "excludes": [ "id" ] }, "properties": { "id": { "type": "keyword" }, "title": { "analyzer": "ik_smart", "type": "text", "fields": { "raw": { "type": "keyword" }, "shingle": { "type": "text", "analyzer": "shingle_analyzer" } } }, "publish_time": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss" } } } } ' curl -H "Content-Type: application/json" -XPOST 'http://192.168.0.1:9200/article/_doc/1' -d ' { "id": "1", "title": "周杰伦、林俊杰、罗志祥、王力宏、潘玮柏、蔡依林、孙燕姿、梁静茹一同参加颁奖典礼", "publish_time": "2019-08-22 17:48:16" } ' curl -H "Content-Type: application/json" -XPOST 'http://192.168.0.1:9200/article/_doc/2' -d ' { "id": "2", "title": "周杰伦、林俊杰、罗志祥、王力宏、潘玮柏一同参加颁奖典礼", "publis

今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

上一篇

已是最后文章

下一篇

已是最新文章

发表回复