Elasticsearch文本分析:API与内置组件详解
1. 使用analyze API分析文本
在追踪信息如何存储在Elasticsearch索引中时,使用analyze API测试分析过程非常有帮助。该API允许你向Elasticsearch发送任何文本,并指定要使用的分析器、分词器或分词过滤器,然后返回分析后的分词。
例如,使用标准分析器分析文本 “share your experience with NoSql & big data technologies”:
% curl -XPOST 'localhost:9200/_analyze?analyzer=standard' -d 'share your experience with NoSql & big data technologies'
输出结果如下:
"tokens" : [ {
"token" : "share",
"start_offset" : 0,
"end_offset" : 5,
"type" : "<ALPHANUM>",
"position" : 1
}, {
"token" : "your",
"start_offset" : 6,
"end_offset" : 10,
"type" : "<ALPHANUM>",
"position" : 2
}, {
"t
超级会员免费看
订阅专栏 解锁全文
1253

被折叠的 条评论
为什么被折叠?



