synonym.txt
电脑, 计算机, 主机
复印纸, 打印纸, A4纸, 纸, A3
平板电脑, Pad
DELETE /es_sku_index_20_20250109
PUT /es_sku_index_20_20250109
{
"settings": {
"index": {
"number_of_shards": "5",
"number_of_replicas": "1",
"analysis": {
"filter": {
"light_english_stemmer": {
"type": "stemmer",
"language": "light_english"
},
"sku_synonym": {
"type": "synonym",
"synonyms_path": "synonym/synonym.txt"
}
},
"analyzer": {
"optik_smart_with_synonym": {
"type": "custom",
"tokenizer": "ik_smart",
"filter": [
"lowercase",
"light_english_stemmer",
"sku_synonym"
]
},
"optik_with_synonym": {
"type": "custom",
"tokenizer": "ik_max_word",
"filter": [
"lowercase",
"light_english_stemmer",
"sku_synonym"
]
},
"optik_smart": {
"type": "custom",
"tokenizer": "ik_smart",
"filter": ["lowercase", "light_english_stemmer"]
},
"optik": {
"type": "custom",
"tokenizer": "ik_max_word",
"filter": ["lowercase", "light_english_stemmer"]
},
"sku_synonym_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase", "sku_synonym"]
}
}
}
}
},
"mappings": {
"sku": {
"properties": {
"chiefQualifications": {
"type": "text"
},
"agreementStatus": {
"type": "long"
},
"sellPrice": {
"type": "double"
},
"saleAttributes": {
"type": "nested",
"properties": {
"attrNames": {
"search_analyzer": "optik_smart",
"analyzer": "optik",
"type": "text"
},
"value": {
"type": "long"
},
"key": {
"type": "long"
}
}
},
"contactTel": {
"type": "text"
},
"categoryKeyWord": {
"search_analyzer": "optik_smart",
"analyzer": "optik",
"type": "text"
},
"isAgent": {
"type": "integer"
},
"skuNameSearch": {
"type": "keyword"
},
"cName": {
"type": "text",
"fields": {
"cName_search": {
"type": "text",
"analyzer": "optik_smart_with_synonym",
"search_analyzer": "optik_smart_with_synonym"
},
"cName_view": {
"type": "keyword"
}
}
},
"modelCode": {
"search_analyzer": "optik_smart",
"analyzer": "optik",
"type": "text"
},
"modified": {
"format": "yyyy-MM-dd HH:mm:ss",
"type": "date"
},
"shelfSkuTime": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"shopId": {
"type": "long"
},
"skuId": {
"type": "long"
},
"policyAttributes": {
"type": "nested",
"properties": {
"valueName": {
"type": "keyword"
},
"value": {
"type": "integer"
},
"key": {
"type": "keyword"
}
}
},
"created": {
"format": "yyyy-MM-dd HH:mm:ss",
"type": "date"
},
"listingTime": {
"format": "yyyy-MM-dd",
"type": "date"
},
"pictureUrl": {
"type": "keyword"
},
"brandKeyWord": {
"type": "text",
"analyzer": "sku_synonym_analyzer",
"search_analyzer": "optik_smart"
},
"itemId": {
"type": "long"
},
"praiseRate": {
"type": "float"
},
"brandNameCh": {
"type": "keyword"
},
"publishType": {
"type": "integer"
},
"brandId": {
"type": "long"
},
"minPrice": {
"type": "double"
},
"keyAttributesNum": {
"type": "integer"
},
"maxPrice": {
"type": "double"
},
"cid": {
"type": "long"
},
"secondTel": {
"type": "text"
},
"supplierId": {
"type": "long"
},
"categoryAttributes": {
"type": "nested",
"properties": {
"value": {
"type": "long"
},
"key": {
"type": "long"
}
}
},
"shopName": {
"type": "text",
"fields": {
"shopName_view": {
"type": "keyword"
},
"shopName_search": {
"type": "text",
"analyzer": "optik_smart_with_synonym",
"search_analyzer": "optik_smart_with_synonym"
}
}
},
"enterpriseScale": {
"type": "integer"
},
"agentNum": {
"type": "integer"
},
"skuName": {
"type": "text",
"analyzer": "optik_smart_with_synonym",
"search_analyzer": "optik_smart_with_synonym"
},
"saleAttributesNum": {
"type": "integer"
},
"supplierName": {
"type": "keyword"
},
"saleCount": {
"type": "long"
},
"secondContacts": {
"type": "text"
},
"keyAttributes": {
"type": "nested",
"properties": {
"attrNames": {
"search_analyzer": "optik_smart",
"analyzer": "optik",
"type": "text"
},
"value": {
"type": "long"
},
"key": {
"type": "long"
}
}
},
"platformId": {
"type": "long"
},
"saleStatus": {
"type": "integer"
},
"otherQualifications": {
"type": "text"
},
"agreementNo": {
"type": "keyword"
},
"brandNameEn": {
"type": "keyword"
},
"sourceSkuId": {
"search_analyzer": "optik_smart",
"analyzer": "optik",
"type": "text"
},
"categoryAttributesNum": {
"type": "integer"
},
"brandNameChEn": {
"type": "text",
"fields": {
"brandNameChEn_agg": {
"type": "keyword"
},
"brandNameChEn_ik": {
"type": "text",
"analyzer": "optik_smart_with_synonym",
"search_analyzer": "optik_smart_with_synonym"
}
}
},
"contacts": {
"type": "text"
}
}
}
},
"aliases": {
"es_sku_index_alias_20": {}
}
}
POST _reindex
{
"source": {
"index": "es_sku_index_20_20221008"
},
"dest": {
"index": "es_sku_index_20_20250109"
}
}
POST /_aliases
{
"actions": [
{ "add": { "index": "es_sku_index_20_20250109", "alias": "es_sku_index_alias_20" } },
{ "remove": { "index": "es_sku_index_20_20221008", "alias": "es_sku_index_alias_20" } }
]
}
GET /es_sku_index_20_20250109/_analyze
{
"analyzer": "optik_smart_with_synonym",
"text": "复印纸"
}
GET /es_sku_index_20_20250109/_analyze
{
"analyzer": "optik_smart_with_synonym",
"text": "打印纸"
}