elasticsearch 常用脚本

本文展示了如何使用Elasticsearch的不同分词器(如IK分词器、mmseg分词器等)来分析中文文本。通过几个具体的例子,如分析“中华人民共和国”这一词条,演示了不同分词器的效果。此外还提供了使用自定义同义词分析器的示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

elasticsearch 常用脚本 博客分类: 搜索引擎,爬虫

http://localhost:9200/zzm/_analyze?analyzer=ik&text=中华人民共和国

 

http://localhost:9200/zzm/_analyze?analyzer=mmseg&text=中华人民共和国

 

http://localhost:9200/zzm/_analyze?analyzer=pinyin&text=中华人民共和国

 

http://localhost:9200/zzm/_analyze?field=content&text=中华人民共和国

 

 

http://localhost:9200/zzm/_analyze?analyzer=ik&text=中华人民共和国
 
http://localhost:9200/zzm/_analyze?analyzer=mmseg&text=中华人民共和国
 
http://localhost:9200/zzm/_analyze?analyzer=pinyin&text=中华人民共和国
 
http://localhost:9200/zzm/_analyze?field=content&text=中华人民共和国

http://localhost:9200/my_index/_analyze?analyzer=my_synonyms&text=Elizabeth is the English queen

http://localhost:9200/my_index2/_analyze?analyzer=my_synonyms&text=天朝 北京

http://localhost:9200/my_index2/_analyze?analyzer=my_synonyms&text=布鼓雷门

http://localhost:9200/zzm/_analyze?analyzer=ik_max_word_synonym&text=番茄

http://localhost:9200/zzm/_analyze?analyzer=ik_max_word_syno&text=es

http://localhost:9200/synonym/_analyze?analyzer=mmseg_synonym&text=番茄


//删除查询范围
curl -XDELETE 'localhost:9800/test/test/_query' -d '{"query":{"term":{"status":"1"}}}'

//删除id
curl -XDELETE 'localhost:9800/test/test/id

转载于:https://my.oschina.net/xiaominmin/blog/1597171

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值