小编col*_*nwr的帖子

将映射应用于Elasticsearch中的子字段

我无法为"hashtags"创建自定义映射,"hashtags"是elasticsearch中"twitter_entities"的子字段.我尝试通过以下方式实现:

 {
    "mappings": {
        "tweet" : {
            "properties": {
                "twitter_entities.hashtags" : {
                    "type" : "multi_field",
                    "fields" : {
                        "hashtag" : {
                            "type" : "string",
                            "analyzer" : "hashtag"
                        },                        
                        "autocomplete" : {
                            "type" : "string",
                            "index_analyzer" : "hashtag_autocomplete",
                            "search_analyzer" : "hashtag"   
                        }
                    }
                }
            }   
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这会创建另一个名为"twitter_entities.hashtags"的根域

 {
    "mappings": {
        "tweet" : {
            "properties": {
                "hashtags" : {
                    "type" : "multi_field",
                    "fields" : {
                        "hashtag" : {
                            "type" : "string",
                            "analyzer" : "hashtag"
                        },                        
                        "autocomplete" : {
                            "type" : …
Run Code Online (Sandbox Code Playgroud)

mapping elasticsearch

5
推荐指数
1
解决办法
3279
查看次数

标签 统计

elasticsearch ×1

mapping ×1