ElasticSearch 获取分词的Token
2015-07-10 15:00
549 查看
用ES建好索引,有时候需要获取索引中的Token。ES提供了两个接口,链接如下:
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/docs-termvectors.html#_term_information
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/docs-multi-termvectors.html#docs-multi-termvectors
典型的用法如下,
需要给出索引名,表名,文档id,及关键词_termvector. 但是,本地测试,上述命令是没有结果的,需要指出相关的域.
这个命令行,还有其他一些选项,如:
具体请看文档.
另一个命令差不多,不过是可以可以作用在多个索引上.
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/docs-termvectors.html#_term_information
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/docs-multi-termvectors.html#docs-multi-termvectors
典型的用法如下,
curl -XGET 'http://localhost:9200/twitter/tweet/1/_termvector?pretty=true'
需要给出索引名,表名,文档id,及关键词_termvector. 但是,本地测试,上述命令是没有结果的,需要指出相关的域.
curl -XGET 'http://localhost:9200/twitter/tweet/1/_termvector?fields=text,...'
这个命令行,还有其他一些选项,如:
curl -XGET 'http://localhost:9200/twitter/tweet/1/_termvector?pretty=true' -d '{ "fields" : ["text"], "offsets" : true, "payloads" : true, "positions" : true, "term_statistics" : true, "field_statistics" : true }'
具体请看文档.
另一个命令差不多,不过是可以可以作用在多个索引上.
相关文章推荐
- shell入门之expr的使用
- HDFS元数据管理
- shell入门之expr的使用
- 函数的指针参数传出时遇到的问题
- Apache服务器的404页面的设置
- shell入门之expr的使用
- WCF技术剖析之二十: 服务在WCF体系中是如何被描述的?
- WCF技术剖析之十九:深度剖析消息编码(Encoding)实现(下篇)
- 一世12年龄在泥土还在打,硅谷00创业毕竟开始播放!
- shell入门之expr的使用 分类: 学习笔记 linux ubuntu 2015-07-10 14:59 76人阅读 评论(1) 收藏
- LeetCode---(58)Length of Last Word
- CSS3 3D transform变换
- AFNetworking、MKNetworkKit和ASIHTTPRequest对比
- android的四种加载模式
- java按指定编码写入和读取文件内容的类
- SQL语句实现模糊查询
- LintCode UniquePathsII 不同的路径II
- 使用Quick-Cocos2d-x开发植物大战僵尸02-地图编辑
- mongodb进阶三之mongodb管理
- WCF技术剖析之十九:深度剖析消息编码(Encoding)实现(上篇)