gpt4 book ai didi

elasticsearch - 无法使用动态模板映射在ouchdb上创建elasticsearch river

转载 作者:行者123 更新时间:2023-12-03 02:10:02 27 4
gpt4 key购买 nike

当我尝试使用动态模板来指定映射时,将对象以外的所有内容都视为字符串,则River失败。

示例-我首先尝试为我的数据库清除所有先前的索引和河流-tempTest。

curl -XDELETE 'localhost:9200/_river/tempTest/'

curl -XDELETE 'localhost:9200/tempTest/'

curl -XPUT localhost:9200/tempTest -d '{
"mappings": {
"tempTest": {
"dynamic_templates" : [
{
"template_obj" : {
"match" : "*",
"match_mapping_type" : "object",
"mapping" : {
"type" : "object"
}
}
},
{
"template_str" : {
"match" : "*",
"mapping" : {
"type" : "string"
}
}
}
]
}
}
}'


curl -XPUT 'localhost:9200/_river/tempTest/_meta' -d '{
"type" : "tempTest",
"couchdb" : {
"host" : "localhost",
"port" : 5984,
"db" : "tempTest",
"filter" : null
},
"index" : {
"index" : "tempTest",
"type" : "tempTest",
"bulk_size" : "100",
"bulk_timeout" : "10ms"
}
}'

完成此操作后,我在elasticsearch错误日志中得到以下错误日志。
[2013-01-16 13:52:33,500][WARN ][river                    ] [Starsmore, Jonothon] failed to create river [tempTest][tempTest]
org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class with value [tempTest]
at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:86)
at org.elasticsearch.river.RiverModule.spawnModules(RiverModule.java:57)
at org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44)
at org.elasticsearch.river.RiversService.createRiver(RiversService.java:135)
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAction.java:86)
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:619)
Caused by: java.lang.ClassNotFoundException: pirates
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.elasticsearch.river.RiverModule.loadTypeModule(RiverModule.java:72)
... 9 more

最佳答案

河流类型必须为couchdb。试试这个:

curl -XPUT 'localhost:9200/_river/tempTest/_meta' -d '{
"type": "couchdb",
"couchdb": {
"host": "localhost",
"port": 5984,
"db": "tempTest",
"filter": null
},
"index": {
"index": "tempTest",
"type": "tempTest",
"bulk_size": "100",
"bulk_timeout": "10ms"
}
}
'

关于elasticsearch - 无法使用动态模板映射在ouchdb上创建elasticsearch river,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14366429/

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