Creating an index

PUT /lrtkdb
{
"mappings": {
"properties": {
"id": {
"type": "keyword"
},
"title": {
"type": "text",
"analyzer": "ik-index",
"search_analyzer": "ik-smart"
},
"pageimage": {
"type": "keyword"
},
"pagetype": {
"type": "keyword"
},
"spidertime": {
"type": "long"
},
"contenttime": {
"type": "long"
},
"tag": {
"type": "text"
},
"cate1": {
"type": "keyword"
},
"cate2": {
"type": "keyword"
},
"attr1": {
"type": "keyword"
}
}
},
"settings": {
"analysis": {
"filter": {
"local_synonym" : {
"type" : "synonym",
"synonyms_path" : "/etc/elasticsearch/analysis-ik/synonym.txt" 
}
},
"analyzer": {
"ik-index": {
"type": "custom",
"tokenizer": "ik_max_word",
"filter": [
"local_synonym"
]
},
"ik-smart": {
"type": "custom",
"tokenizer": "ik_smart",
"filter": [
"local_synonym"
]
}
}
}
}
 
}

 

Guess you like

Origin www.cnblogs.com/likecs/p/12060828.html