curl -XPUT http://127.0.0.1:19800/forecast_v2 -d '{ "settings": { "index": { "analysis": { "analyzer": { "douhao": { "type": "pattern", "pattern": "," }, "my_ngram_title": { "filter": [ "lowercase" ], "tokenizer": "my_ngram_title" }, "my_ngram": { "filter": [ "lowercase" ], "tokenizer": "my_ngram" } }, "tokenizer": { "my_ngram_title": { "token_chars": [ "letter", "digit", "punctuation", "symbol" ], "min_gram": "1", "type": "nGram", "max_gram": "1" }, "my_ngram": { "token_chars": [ "letter", "digit" ], "min_gram": "2", "type": "nGram", "max_gram": "2" } } }, "number_of_shards": "20", "number_of_replicas": "0" } }, "mappings": { "forecast": { "transform": { "lang": "groovy", "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]" }, "_id": { "path": "_id" }, "_all": { "enabled": false }, "properties": { "area": { "index": "not_analyzed", "type": "string" }, "city": { "index": "not_analyzed", "type": "string" }, "nature": { "index": "not_analyzed", "type": "string" }, "buyer": { "index": "not_analyzed", "type": "string" }, "buyerclass": { "index": "not_analyzed", "type": "string" }, "title": { "analyzer": "my_ngram_title", "type": "string" }, "projectname": { "index": "not_analyzed", "type": "string", "fields": { "pname": { "type": "string" } } }, "projectcode": { "index": "not_analyzed", "type": "string" }, "spidercode": { "index": "not_analyzed", "type": "string" }, "stage": { "index": "not_analyzed", "type": "string" }, "main_project": { "index": "not_analyzed", "type": "string" }, "top_category": { "index": "not_analyzed", "type": "string" }, "sub_category": { "index": "not_analyzed", "type": "string" }, "approvestatus": { "index": "not_analyzed", "type": "string" }, "href": { "index": "not_analyzed", "type": "string" }, "jyhref": { "index": "not_analyzed", "type": "string" }, "publishtime": { "type": "long" }, "yucetime": { "type": "long" }, "yucestarttime": { "type": "long" }, "yuceendtime": { "type": "long" }, "results": { "properties": { "purchasing": { "analyzer": "douhao", "type": "string", "fields": { "mypurchasing": { "analyzer": "my_ngram_title", "type": "string" } } }, "p_projects": { "properties": { "p_purchasing": { "index": "not_analyzed", "type": "string" }, "p_id": { "index": "not_analyzed", "type": "string" }, "p_orther": { "index": "not_analyzed", "type": "string" }, "p_phone": { "index": "not_analyzed", "type": "string" }, "p_person": { "index": "not_analyzed", "type": "string" } } } } } } } } }'