Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json 创建映射时R弹性包中的词法错误_Json_R_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch - Fatal编程技术网 elasticsearch,Json,R,elasticsearch" /> elasticsearch,Json,R,elasticsearch" />

Json 创建映射时R弹性包中的词法错误

Json 创建映射时R弹性包中的词法错误,json,r,elasticsearch,Json,R,elasticsearch,我在执行R包(elastic_0.7.8)的某些函数时遇到问题。具体来说,我尝试使用mapping\u create函数从JSON字符串创建映射 无论我使用哪种JSON格式,我总是会得到相同的错误。例如,执行(第38页)中的一个示例: 任何帮助都将不胜感激 编辑2: 从github安装新版本后,显示另一个错误: > mapping_create(index = "plos", type = "citation", body=body) Error: 404 - no such index

我在执行R包(elastic_0.7.8)的某些函数时遇到问题。具体来说,我尝试使用
mapping\u create
函数从JSON字符串创建映射

无论我使用哪种JSON格式,我总是会得到相同的错误。例如,执行(第38页)中的一个示例:

任何帮助都将不胜感激

编辑2:

从github安装新版本后,显示另一个错误:

> mapping_create(index = "plos", type = "citation", body=body)
Error: 404 - no such index
sessionInfo()
结果:

other attached packages:
[1] data.table_1.10.0  R.utils_2.5.0      R.oo_1.21.0        R.methodsS3_1.7.1  elastic_0.7.8.9614

loaded via a namespace (and not attached):
[1] httr_1.2.1   R6_2.2.0     tools_3.3.2  curl_2.6     jsonlite_1.5
编辑3

> config=httr::verbose()
> print(config)
<request>
Options:
* debugfunction: function (type, msg) 
{
    switch(type + 1, text = if (info) prefix_message("*  ", msg), headerIn = prefix_message("<- ", msg), headerOut = prefix_message("-> ", msg), dataIn = if (data_in) prefix_message("<<  ", msg, TRUE), dataOut = if (data_out) prefix_message(">> ", msg, TRUE), sslDataIn = if (data_in && ssl) prefix_message("*< ", msg, TRUE), sslDataOut = if (data_out && ssl) prefix_message("*> ", msg, TRUE))
}
* verbose: TRUE
>config=httr::verbose()
>打印(配置)
选项:
*debugfunction:function(类型,msg)
{
开关(type+1,text=if(info)prefix\u message(“*”,msg),headerIn=prefix\u message(“,msg),dataIn=if(data\u in)prefix\u message(“>”,msg,TRUE),sslDataIn=if(data\u in&&ssl)prefix\u message(“*<”,msg,TRUE),sslDataOut=if(data\u out&&ssl)prefix\u message(“*>,msg,TRUE))
}
*详细:正确

elastic
维护者-您使用的是哪个R版本和
elasticsearch
版本?解析JSON时似乎出现了问题。而
mapping\u get(index=“plos”,type=“引证”,config=httr::verbose())
给了你什么(编校敏感URL/端口/任何东西)你有没有试过将
es\u path
保留为NULL(与
)呢?我认为通常不需要这样做,除非你在基后面有一些字符URL@sckott使用
es_path=“”
我得到
错误:404-没有这样的索引
。我在想,这可能与Elasticsearch 5.x中的API更改有关,但我看到的唯一更改是现在禁止使用无引号的JSON。您是在给
es_host
添加尾随斜杠还是不添加尾随斜杠?这有区别吗?我想是的——如果是这样,我们可以改进正常化urls@sckott如果我使用尾随斜杠,我会得到问题中的消息(
错误:词法错误:无效…
)。如果我不使用尾随斜杠(
es_host=”“
),我只会收到消息
错误:404-这里没有这样的索引
弹性
维护者-您使用的是哪个R版本和
弹性搜索
版本?解析JSON时似乎出现了问题。而
mapping\u get(index=“plos”,type=“引证”,config=httr::verbose())
给了你什么(编校敏感URL/端口/任何东西)你有没有试过将
es\u path
保留为NULL(与
)呢?我认为通常不需要这样做,除非你在基后面有一些字符URL@sckott使用
es_path=“”
我得到
错误:404-没有这样的索引
。我在想,这可能与Elasticsearch 5.x中的API更改有关,但我看到的唯一更改是现在禁止使用无引号的JSON。您是在给
es_host
添加尾随斜杠还是不添加尾随斜杠?这有区别吗?我想是的——如果是这样,我们可以改进正常化urls@sckott如果我使用尾随斜杠,我会得到问题中的消息(
错误:词法错误:无效…
)。如果我不使用尾随斜杠(
es_host=”“
),我只会收到消息
错误:404-没有这样的索引。
other attached packages:
[1] data.table_1.10.0  R.utils_2.5.0      R.oo_1.21.0        R.methodsS3_1.7.1  elastic_0.7.8.9614

loaded via a namespace (and not attached):
[1] httr_1.2.1   R6_2.2.0     tools_3.3.2  curl_2.6     jsonlite_1.5
> config=httr::verbose()
> print(config)
<request>
Options:
* debugfunction: function (type, msg) 
{
    switch(type + 1, text = if (info) prefix_message("*  ", msg), headerIn = prefix_message("<- ", msg), headerOut = prefix_message("-> ", msg), dataIn = if (data_in) prefix_message("<<  ", msg, TRUE), dataOut = if (data_out) prefix_message(">> ", msg, TRUE), sslDataIn = if (data_in && ssl) prefix_message("*< ", msg, TRUE), sslDataOut = if (data_out && ssl) prefix_message("*> ", msg, TRUE))
}
* verbose: TRUE