elasticsearch中的Map解析器异常

iyr7buue  于 2021-06-13  发布在  Cassandra
关注(0)|答案(2)|浏览(470)

我在Cassandra创建了udt

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

然后在我的table上用这个udt

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

当我点击查询elasticsearch mapping时收到一个错误
query:-

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

error:-

"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\">"}]
uxhixvfz

uxhixvfz1#

您能否提供最终的json文档(同时检查您是否能够使用相同的json创建Map),您正在使用该文档创建索引Map,当我们不提供elasticsearch(es)可以解析的Map时,Map器解析异常就会出现。
你还应该提供整个 stacktrace 为了更好地理解这个问题,您似乎正在使用静态Map,并且尝试插入包含字段的文档,该字段在esMap中不存在,或者该字段的格式不正确,即尝试在数字字段中插入文本等。

bpsygsoo

bpsygsoo2#

找到:
cqlMap目前只支持作为文档的顶级字段,我们不能在嵌套字段中使用它。

相关问题