Commit 027c2229 authored by 李小芳's avatar 李小芳

修改mapping

parent 0d607438
{
"dynamic": "strict",
"properties": {
"id": {
"type": "long"
},
"name": {
"type": "string"
},
"mapping_type": {
"type": "string"
},
"is_online": {
"type": "boolean"
},
"create_time": {
"type": "date",
"format": "date_time_no_millis"
},
"update_time": {
"type": "date",
"format": "date_time_no_millis"
},
"last_content_create_time": {
"type": "date",
"format": "date_time_no_millis"
},
"last_content_comment_time": {
"type": "date",
"format": "date_time_no_millis"
},
"tag_ids": {
"type": "long"
},
"tag_names": {
"type": "string",
"analyzer": "gm_default_index",
"search_analyzer": "gm_default_search"
},
"user_ids": {
"type": "long"
},
"user_follow_number": {
"type": "long"
},
"tags_v3_ids": {
"type": "long"
},
"tags_v3_name": {
"type": "string",
"index":"not_analyzed"
},
"is_show_index": {
"type": "boolean"
"mappings": {
"properties": {
"id": {
"type": "long"
},
"name": {
"type": "keyword"
},
"mapping_type": {
"type": "keyword"
},
"is_online": {
"type": "boolean"
},
"create_time": {
"type": "date",
"format": "date_time_no_millis"
},
"update_time": {
"type": "date",
"format": "date_time_no_millis"
},
"last_content_create_time": {
"type": "date",
"format": "date_time_no_millis"
},
"last_content_comment_time": {
"type": "date",
"format": "date_time_no_millis"
},
"tag_ids": {
"type": "long"
},
"tag_names": {
"type": "text",
"analyzer": "gm_default_index",
"search_analyzer": "gm_default_search"
},
"user_ids": {
"type": "long"
},
"user_follow_number": {
"type": "long"
},
"tags_v3_ids": {
"type": "long"
},
"tags_v3_name": {
"type": "keyword"
},
"is_show_index": {
"type": "boolean"
}
}
}
}
......@@ -111,11 +111,7 @@ def put_mapping(es, index_prefix, doc_type, mapping, delete=False):
import copy
mapping_copy = copy.deepcopy(mapping)
mapping_copy = _mapping_modify(es, doc_type, mapping_copy)
print(mapping_copy)
print(index)
print(doc_type)
return cl.put_mapping(index=index, doc_type=doc_type, body=mapping_copy)
return cl.put_mapping(index=index, doc_type="_doc", body=mapping_copy)
def alias_shift(es, alias, old_index, new_index):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment