[ElasticSearch] mappings and type
来源:互联网 发布:郑州大学网络自助平台 编辑:程序博客网 时间:2024/06/07 02:37
http://www.cnblogs.com/buzzlight/p/elasticsearch_mapping_fields.html
require 'elasticsearch'$client = Elasticsearch::Client.new hosts:['127.0.0.1'],randomize_hosts:truedef create_index $client.indices.create index:'weibo',body:{ settings: { index: { number_of_shards: 10, number_of_replicas: 1 } }, mappings: { weibo: { _all: { analyzer: "ik_max_word", search_analyzer: "ik_max_word", }, properties: { content: { type: 'string', analyzer: 'ik_max_word', search_analyzer: 'ik_max_word' }, tags: { type: 'string', index: "not_analyzed" }, site_user: { type: 'string', index: 'not_analyzed' }, created_time: { type: 'integer' }, created_date: { type: 'string', index: 'not_analyzed' }, } } }, blog:{ _all:{ analyzer: "ik_max_word", search_analyzer: "ik_max_word", }, properties:{ title: { type: 'string', analyzer: 'ik_max_word', search_analyzer: 'ik_max_word' }, content: { type: 'string', index: "not_analyzed" }, tags: { type: 'string', index: "not_analyzed" }, site_user: { type: 'string', index: 'not_analyzed' }, created_time: { type: 'integer' }, created_date: { type: 'string', index: 'not_analyzed' }, } } }end# create_indexdef create_type $client.index index: 'weibo', type: 'weibo', id: '1', body: { content: '//1.昆凌:“因为这个月18号我要去一件重要的事.” 2.主持人说,最近周杰伦宣传期接受了一些采访,你知道吗,他说“没有人会不喜欢你.”昆凌听后还在哭[泪] 祝福你和杰伦能永远幸福下去!倒计时14天~', tags: [ '周杰伦', '昆凌' ], site_user: 'BettyHu-', created_time: 1420435348, created_date: '20150105' } $client.index index:'weibo',type:'blog',id:'1',body:{ content: 'this is my first blog', title: 'how to use ruby array', tags: [ 'ruby', 'array' ], site_user: 'kla-', created_time: 1420435348, created_date: '20150105' } $client.index index:'weibo',type:'comment',id:'1',body:{ content: 'so good news', tags: [ '周杰伦', '昆凌' ], site_user: 'kla-', created_time: 1420435348, created_date: '20150105' }end# create_typedef add_data $client.index index:'weibo',type:'comment',id:'2',body:{ comment_id:'001', content: 'so good news', tags: [ '周杰伦', '昆凌' ], site_user: 'kla-', created_time: 1420435348, created_date: '20150105' }endadd_data
0 0
- [ElasticSearch] mappings and type
- Elasticsearch mappings小结
- ElasticSearch(Settings,Mappings)
- Java Type to SQL Type Mappings
- Red5 AMF3 Flex : Data Type Mappings
- Add mappings to an Elasticsearch index in realtime
- ElasticSearch-PHP:自定义分词规则 Mappings的创建
- List of the Most Common Data Type Mappings
- default mappings from payload type numbers to encodings
- elasticsearch index type
- elasticsearch scripts of type [inline], operation [update] and lang [groovy] are disabled
- elasticsearch index 的 type 解释
- elasticsearch查看type的mapping
- Elasticsearch--scan and scroll
- elasticsearch and or
- elasticsearch index and store
- Value Type And Reference Type
- Nested Mappings
- 关闭Eclipse按空格和等号键自动补全内容
- lua基本实验
- sql基础03—数据类型
- 非UI主线程如何弹出Toast以及Handler.post()流程分析
- java mail(发送邮件--163邮箱)
- [ElasticSearch] mappings and type
- PianoView-添加一行代码使用[最美应用]的酷炫控件!
- ajax跨域
- iOS 集成支付宝支付编译出现的问题及解决办法
- 欢迎使用CSDN-markdown编辑器
- 229,一次性执行代码
- CSS3实现3级动画菜单
- 国内的专业Linux网站(GB)
- 快速使用Python2.7和Django1.9