gpt4 book ai didi

jdbc - 为JDBC Elasticsearch River设置映射

转载 作者:行者123 更新时间:2023-12-02 22:17:51 24 4
gpt4 key购买 nike

我正在将ES 0.20.6与elasticsearch-river-jdbc plugin一起使用。
我使用以下方法创建了一条河:

SQL="SELECT ..."
curl -XPUT 'localhost:9200/_river/myindex_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"driver" : "org.postgresql.Driver",
"url" : "jdbc:postgresql://localhost:5432/mydb_db",
"user" : "myuser",
"password" : "mypassword",
"sql" : "'"$SQL"'"
},
"index" : {
"index" : "myindex",
"type" : "mytype",
"type_mapping" : null
}
}'

现在我想要的是将类型映射添加为 the option is defined in the plugin documentation。但是我真的无法弄清楚语法,总是会遇到以下错误( "Source: "部分根据我的尝试而有所不同)
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping definition
at org.elasticsearch.index.mapper.DocumentMapperParser.extractMapping(DocumentMapperParser.java:237)
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:147)
at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:379)
at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:375)
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:309)
at org.elasticsearch.cluster.service.InternalClusterService$2.run(InternalClusterService.java:223)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.elasticsearch.common.jackson.core.JsonParseException: Unexpected character ('=' (code 61)): was expecting a colon to separate field name and value
at [Source: {mytype={properties={active={index_analyzer=standard, store=yes, type=boolean}}}}; line: 1, column: 9]
at org.elasticsearch.common.jackson.core.JsonParser._constructError(JsonParser.java:1378)
at org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
at org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:520)
at org.elasticsearch.common.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:616)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:48)
at org.elasticsearch.common.xcontent.support.XContentMapConverter.readMap(XContentMapConverter.java:70)
at org.elasticsearch.common.xcontent.support.XContentMapConverter.readOrderedMap(XContentMapConverter.java:60)
at org.elasticsearch.common.xcontent.support.AbstractXContentParser.mapOrdered(AbstractXContentParser.java:116)
at org.elasticsearch.index.mapper.DocumentMapperParser.extractMapping(DocumentMapperParser.java:235)
... 8 more

最佳答案

我认为您提交的东西甚至都不是正确的json对象。我可以想象到type_mapping对象必须包含映射,与使用put mapping api否则使用creating索引提交的映射几乎相同。

关于jdbc - 为JDBC Elasticsearch River设置映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16012433/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com