diff --git a/src/main/resources/es_mpoint_init.script b/src/main/resources/es_mpoint_init.script new file mode 100644 index 00000000..fe37d333 --- /dev/null +++ b/src/main/resources/es_mpoint_init.script @@ -0,0 +1,294 @@ +GET _search +{ + "query": { + "match_all": {} + } +} + +# Elasticsearch Index Initialization Script for MPoint +# Index: es_measurepoint +# Type: esmeasurepoint +# Generated from: MPoint.java entity + +# Step 1: Delete existing index (if exists) +DELETE /es_measurepoint + +PUT /es_measurepoint +{ + "settings": { + "number_of_shards": 1, + "number_of_replicas": 0, + "analysis": { + "normalizer": { + "my_normalizer": { + "type": "custom", + "char_filter": [], + "filter": [ + "lowercase", + "asciifolding" + ] + } + } + } + }, + "mappings": { + "esmeasurepoint": { + "properties": { + "mpointcode": { + "type": "keyword", + "normalizer": "my_normalizer" + }, + "parmname": { + "type": "text", + "analyzer": "ik_smart", + "search_analyzer": "ik_smart" + }, + "id": { + "type": "keyword" + }, + "mpointid": { + "type": "keyword" + }, + "unit": { + "type": "keyword" + }, + "alarmmax": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "alarmmin": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "halarmmax": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "lalarmmin": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "parmvalue": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "parmvalueStr": { + "type": "keyword" + }, + "measuredt": { + "type": "date", + "format": "yyyy-MM-dd'T'HH:mm:ss'Z'||yyyy-MM-dd HH:mm:ss||epoch_millis" + }, + "rate": { + "type": "scaled_float", + "scaling_factor": 1000 + }, + "freq": { + "type": "integer" + }, + "frequnit": { + "type": "keyword" + }, + "signaltype": { + "type": "keyword" + }, + "signaltag": { + "type": "keyword" + }, + "ledtype": { + "type": "keyword" + }, + "ledcolor": { + "type": "keyword" + }, + "directtype": { + "type": "keyword" + }, + "bizid": { + "type": "keyword" + }, + "biztype": { + "type": "keyword" + }, + "numtail": { + "type": "keyword" + }, + "prochour": { + "type": "keyword" + }, + "procday": { + "type": "keyword" + }, + "procmonth": { + "type": "keyword" + }, + "showname": { + "type": "text", + "analyzer": "standard", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "exp": { + "type": "text" + }, + "forcemin": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "forcemax": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "avgmax": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "avgmin": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "remoteup": { + "type": "keyword" + }, + "morder": { + "type": "integer" + }, + "triggeralarm": { + "type": "keyword" + }, + "confirmalarm": { + "type": "keyword" + }, + "flowset": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "triggercycle": { + "type": "keyword" + }, + "cyclemax": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "cyclemin": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "triggermutation": { + "type": "keyword" + }, + "mutationset": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "causeset": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "operateset": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "resultset": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "triggerequoff": { + "type": "keyword" + }, + "mathop": { + "type": "keyword" + }, + "valuetype": { + "type": "keyword" + }, + "valuemeaning": { + "type": "text" + }, + "active": { + "type": "keyword" + }, + "soundalarm": { + "type": "keyword" + }, + "scdtype": { + "type": "keyword" + }, + "spanrange": { + "type": "scaled_float", + "scaling_factor": 100 + }, + "modbusfigid": { + "type": "keyword" + }, + "register": { + "type": "keyword" + }, + "processsectioncode": { + "type": "keyword" + }, + "equipmentid": { + "type": "keyword" + }, + "source_type": { + "type": "keyword" + }, + "patrol_type": { + "type": "keyword" + }, + "remark": { + "type": "text" + }, + "alarmLevel": { + "type": "integer" + }, + "structureId": { + "type": "keyword" + }, + "bizname": { + "type": "text", + "analyzer": "standard", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "disname": { + "type": "text", + "analyzer": "standard", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "subscriptionStatus": { + "type": "integer" + }, + "text": { + "type": "text", + "analyzer": "standard" + } + } + } + } +} + + +POST /es_measurepoint/_close + +POST /es_measurepoint/_open + +# Step 3: Verify index creation +GET /es_measurepoint/_mapping + +# Step 4: Check index settings +GET /es_measurepoint/_settings +