我正在使用Elassandra来搜索邮件,使用Cassandra来保存邮件,使用ElasticSearch来搜索那些邮件。

我的问题是,从ElasticSearch 6开始,我们不能在一个映射中使用多种类型。这是我的映射:

"mappings": {
    "mail__mail": {
        "discover" : ".*",
        "properties": {
            "mailfrom": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "type": "keyword"
                    },
                    "ngram": {
                        "type": "text",
                        "analyzer": "edge_ngram_analyzer",
                        "search_analyzer": "edge_ngram_search_analyzer"
                    }
                }
            },
            "subject": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "type": "keyword"
                    },
                    "ngram": {
                        "type": "text",
                        "analyzer": "edge_ngram_analyzer",
                        "search_analyzer": "edge_ngram_search_analyzer"
                    }
                }
            },
            "date" : {
                "type" : "date"
            },
            "folderid" : {
                "type" : "text"
            }
        }
    },
    "mail__account" : {
        "discover" : ".*",
        "properties": {
            "userId" : {
                "type" : "Integer"
            }
        }
    }
}

如何使用ElasticSearch 6在多个cassandra表中搜索?

最佳答案

从ES6开始,您需要为每个索引映射1个表。
搜索多个索引:

https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html

关于elasticsearch - Elassandra多类型映射,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52384138/

10-11 09:07
查看更多