码迷,mamicode.com
首页 > 其他好文 > 详细

elasticsearch添加索引

时间:2019-09-10 11:38:01      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:sts   and   com   number   template   fresh   lte   text   limit   

--创建索引
PUT http://127.0.0.1:9200/spark_index_sl_1
head Content-Type:application/json;charset=utf-8

--设置mapping大小
PUT http://127.0.0.1:9200/spark_index_sl_1
head Content-Type:application/json;charset=utf-8
body

{
"settings": {
"refresh_interval":"600s",
"index.mapping.total_fields.limit": 200000,
"number_of_shards" : 16,
"number_of_replicas": 1,
"analysis": {
"filter": {
"jieba_stop": {
"type": "stop",
"stopwords_path": "plugins/jieba/dic/stopwords.txt"
},
"jieba_synonym": {
"type": "synonym",
"synonyms_path": "plugins/jieba/dic//synonyms.txt"
}
},
"analyzer": {
"sl_index": {
"tokenizer": "jieba_index",
"filter": [
"lowercase",
"jieba_stop",
"jieba_synonym"
]
},
"sl_search": {
"tokenizer": "jieba_search",
"filter": [
"lowercase",
"jieba_stop",
"jieba_synonym"
]
},
"sl_quote": {
"tokenizer": "jieba_index",
"filter": [
"lowercase",
"jieba_synonym"
]
}
}
}
},
"mappings": {
"_doc": {
"dynamic_templates": [{
"project_sentiment_": {
"match": "project_sentiment_*",
"mapping": {
"ignore_above": 10000,
"type": "integer"
}
}
}],

"numeric_detection": true,
"date_detection": false,
"properties": {
"age_seg": {
"type": "integer"
},
"age": {
"type": "integer"
},
"author": {
"type": "keyword"
},
"author_id": {
"type": "keyword"
},
"author_id_md5": {
"type": "keyword"
},
"car_owner": {
"type": "integer"
},
"category_1st": {
"type": "keyword"
},
"category_2nd": {
"type": "keyword"
},
"content": {
"type": "text",
"analyzer":"sl_index",
"search_analyzer":"sl_search",
"search_quote_analyzer":"sl_quote"
},
"content_p": {
"type": "text",
"analyzer":"sl_index",
"search_analyzer":"sl_search",
"search_quote_analyzer":"sl_quote"
},
"ctime": {
"type": "date",
"format": "yyyy-MM-dd"
},
"doc_type": {
"type": "integer"
},
"favourites_count": {
"type": "integer"
},
"floors": {
"type": "integer"
},
"followers_count": {
"type": "integer"
},
"gender": {
"type": "integer"
},
"is_topics": {
"type": "integer"
},
"issue_time": {
"type": "date",
"format": "yyyy-MM-dd"
},
"pgcugc": {
"type": "integer"
},
"pid": {
"type": "keyword",
"ignore_above":10000
},
"sites_type_id": {
"type": "integer"
},
"platform_type_id": {
"type": "integer"
},
"province_id": {
"type": "integer"
},
"sentence": {
"type": "nested",
"properties": {
"attribute_1st": {
"type": "keyword"
},
"attribute_2nd": {
"type": "keyword"
},
"attribute_3rd": {
"type": "keyword"
},
"attribute_4th": {
"type": "keyword"
},
"brand": {
"type": "keyword"
},
"car_series": {
"type": "keyword"
},
"sentiments": {
"type": "integer"
},
"sentiments_word": {
"type": "keyword"
},
"word_cloud": {
"type": "keyword"
}
}
},
"sentiment": {
"type": "integer"
},
"sites_id": {
"type": "integer"
},
"title": {
"type": "text",
"analyzer":"sl_index",
"search_analyzer":"sl_search",
"search_quote_analyzer":"sl_quote"
},
"title_p": {
"type": "text",
"analyzer":"sl_index",
"search_analyzer":"sl_search",
"search_quote_analyzer":"sl_quote"
},
"update_interaction": {
"type": "integer"
},
"update_shares": {
"type": "integer"
},
"update_reposts": {
"type": "integer"
},
"update_dislikes": {
"type": "integer"
},
"update_likes": {
"type": "integer"
},
"update_comments_count": {
"type": "integer"
},
"update_clicks": {
"type": "integer"
},
"update_utility":{
"type":"integer"
},
"all_interaction":{
"type":"integer"
},
"correct_clicks": {
"type": "integer"
},
"correct_comments_count": {
"type": "integer"
},
"correct_likes": {
"type": "integer"
},
"correct_dislikes": {
"type": "integer"
},
"correct_reposts": {
"type": "integer"
},
"correct_shares": {
"type": "integer"
},
"friends_count": {
"type": "integer"
},
"bi_followers_count": {
"type": "integer"
},
"channel_id": {
"type": "integer"
},
"post_id": {
"type": "keyword"
},
"carseries_block": {
"type": "keyword"
},
"car_flag": {
"type": "integer"
},
"province_name": {
"type": "text",
"analyzer":"sl_index",
"search_analyzer":"sl_search",
"search_quote_analyzer":"sl_quote"
},
"month":{
"type":"integer"
},
"avatar_hd":{
"type":"keyword"
},
"p_pid": {
"type": "keyword"
},
"cluster_id": {
"type": "keyword"
},
"cluster_title": {
"type": "keyword"
},
"p_author": {
"type": "keyword"
},
"p_author_id": {
"type": "keyword"
},
"p_author_id_md5": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"tag": {
"type": "keyword"
},
"project_open": {
"type": "keyword"
},
"project_close": {
"type": "keyword"
},
"cluster_ctime": {
"type": "keyword"
}
}
}
}
}

elasticsearch添加索引

标签:sts   and   com   number   template   fresh   lte   text   limit   

原文地址:https://www.cnblogs.com/flymin/p/11496478.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!