123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- 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"
- }
- }
- }
- }
- }
- }
- }
- }
- }'
|