侧边栏壁纸
博主头像
飞云资料栈博主等级

行动起来,活在当下

  • 累计撰写 91 篇文章
  • 累计创建 7 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

集群添加拼音分词器.md

Fly
Fly
2021-11-14 / 0 评论 / 0 点赞 / 60 阅读 / 2786 字
PUT http://192.168.1.7:9200/haoke/

{
    "settings": {
        "index": {
            "number_of_shards": 6,
            "number_of_replicas": 1,
	    "analysis": {
                "analyzer": {
                    "pinyin_analyzer": {
                        "tokenizer": "my_pinyin"
                    }
                },
                "tokenizer": {
                    "my_pinyin": {
                        "type": "pinyin",
                        "keep_separate_first_letter": false,
                        "keep_full_pinyin": true,
                        "keep_original": true,
                        "limit_first_letter_length": 16,
                        "lowercase": true,
                        "remove_duplicated_term": true
                    }
                }
            }
        }
    },
    "mappings": {
        "house": {
            "dynamic": false,
            "properties": {
                "title": {
                    "type": "text",
                    "analyzer":"ik_max_word",
                    "fields":{
                    	"pinyin":{
                    		"type": "text",
                    		"analyzer": "pinyin_analyzer"
                    	}
                    }
                },
                "image": {
                    "type": "keyword",
                    "index":false
                },
                "orientation": {
                    "type": "keyword",
                    "index":false
                },
                "houseType": {
                    "type": "keyword",
                    "index":false
                },
                "rentMethod": {
                    "type": "keyword",
                    "index":false
                },
                "time": {
                    "type": "keyword",
                    "index":false
                },
                "rent": {
                    "type": "keyword",
                    "index":false
                },
                "floor": {
                    "type": "keyword",
                    "index":false
                }
            }
        }
    }
}

0

评论区