import requests


es_mapping =    """{"settings": {
            "analysis": {
                "analyzer": {
                    "ik": {
                        "tokenizer": "ik_max_word"
                    }
                }
            }
        },
        "mappings": {
            "content": {
                "include_in_all": false,
                "properties": {
                    "company_name": {"type": "text},
                    "legal_person"
                    "registered_capital"
                    "telephone_number"
                    "email"
                    "company_url"
                    "address"
                    "registration_time": {"type":"date", "format":"yyyy-MM-dd HH:mm:ss"}
                    "company_state"
                    "latest_update_time": {"type":"date", "format":"yyyy-MM-dd HH:mm:ss"},
                    "registration_number": {"type": "integer"}
                    "organization_code": {"type": "integer"}
                    "uniform_credit_code" {"type": "string", "index": "not_analyzed"}
                    "company_type"
                    "taxpayer_number"
                    "industry"
                    "business_term"
                    "approval_date": {"type":"date", "format":"yyyy-MM-dd HH:mm:ss"}
                    "registration_authority"
                    "english_name"
                    "registered_address"
                    "operation_scope"
                    "devUnique": {"type": "keyword", "index": "not_analyzed", "eager_global_ordinals": true},
                    "time": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"},
                    "reportType": {"type": "integer"},
                    "priority": {"type": "integer"},
                    "dataType": {"type": "string", "index": "not_analyzed"},
                    "collectMode": {"type": "integer"},
                    "policyType": {"type": "string", "index": "not_analyzed"},
                    "filePath": {"type": "string", "index": "not_analyzed"},
                    "datetime": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"},
                    "localTime": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"},
                    "manufacturer": {"type": "string", "index": "not_analyzed"},
                    "model": {"type": "string", "index": "not_analyzed"},
                    "flash": {"type": "integer"},
                    "imgLength": {"type": "integer"},
                    "imgWidth": {"type": "integer"},
                    "location": {"type": "geo_point"},
                    "gpsTimeStamp": {"type": "text", "fields": {"keyword": {"type": "keyword", "ignore_above": "256"}}},
                    "gpsDateStamp": {"type": "text", "fields": {"keyword": {"type": "keyword", "ignore_above": "256"}}},
                    "processingMethod": {"type": "string"},
                    "address": {"type": "text", "index": "not_analyzed"}
                }
            }}}"""
response = requests.put('http://localhost:9200/company66', data=es_mapping )

print(response)