0

我在 Cassandra 中创建了 UDT

CREATE type starter.random_data_demo(  
   destination_wise_count map<text,text>
);

然后在我的表中使用了这个 udt

CREATE TABLE demo(
   field_data FROZEN<random_data_demo> PRIMARY KEY 
   );

当我点击查询弹性搜索映射时收到错误

询问:-

curl -XPUT -H 'Content-Type:application/json' "http://localhost:9200/demo" -d '{
    "settings": { "keyspace":"starter" },
    "mappings": {
        "demo" : {
            "discover" : ".*"
        }
    }
}'

错误:-

"type":"mapper_parsing_exception","reason":"Failed to execute query:null : Field \"destination_wise_count\" with type map<text, text> does not match type frozen<\"testing.demo_field_data_destination_wise_count\">"}]
4

2 回答 2

0

您能否提供用于创建索引映射的最终 JSON 文档(也检查是否使用相同的 JSON 可以创建映射),当我们不提供 Elasticsearch(ES) 可以提供的映射时,映射器解析异常会出现解析。

您还应该提供整个stacktrace以更多地了解问题,似乎您正在使用静态映射并尝试插入包含在 ES 映射中不存在或字段格式不正确的字段的文档,即尝试在数字字段等中插入文本。

于 2020-08-13T09:58:55.993 回答
0

成立:

CQL map 目前仅支持作为文档的顶级字段,我们不能在嵌套字段中使用它。

于 2020-08-14T09:15:24.767 回答