简体   繁体   English

在 Elasticsarch 中映射解析器异常

[英]Mapping Parser Exception in Elasticsarch

I have created UDT in Cassandra我在 Cassandra 中创建了 UDT

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

then used this udt in my table然后在我的表中使用了这个 udt

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

when i hit query for elasticsearch mapping receives an error当我查询 elasticsearch 映射时收到错误

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

Can you provide the final JSON document(also checks if using same JSON you are able to create mapping), which you are using to create the index mapping, mapper parsing exception comes when we don't supply the mapping which Elasticsearch(ES) can parse.您能否提供用于创建索引映射的最终 JSON 文档(还检查是否使用相同的 JSON 可以创建映射),当我们不提供 Elasticsearch(ES) 可以提供的映射时,映射器解析异常会出现解析。

You should also provide the entire stacktrace to understand the issue more, it seems you are using the static mapping and trying to insert the document which contains the field which is either not present in ES mapping or not format of the field is not proper ie trying to insert text in numeric field etc.您还应该提供整个堆栈跟踪以更多地了解该问题,看来您正在使用stacktrace映射并尝试插入包含在 ES 映射中不存在或字段格式不正确的字段的文档,即尝试在数字字段中插入文本等。

Found:成立:

CQL map is currently only supported as a top-level field of a document, we cannot use it in a nested field. CQL map 目前仅支持作为文档的顶级字段,我们不能在嵌套字段中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM