JOLT字符串的JSON数组
我正在尝试将字符串数组转换为常规字符串。但在我的规范文件中,它总是以数组的形式返回 样本输入(来自ES) 输出:JOLT字符串的JSON数组,json,jolt,Json,Jolt,我正在尝试将字符串数组转换为常规字符串。但在我的规范文件中,它总是以数组的形式返回 样本输入(来自ES) 输出: { "Response" : [ { "firstName" : "test", "h_message" : [ "some message with the <em>number</em> <em>1</em>" ] } ], "total_hits" : 1 } { “答复”:[{ “firstName
{
"Response" : [ {
"firstName" : "test",
"h_message" : [ "some message with the <em>number</em> <em>1</em>" ]
} ],
"total_hits" : 1
}
{
“答复”:[{
“firstName”:“test”,
“h_消息”:[“数字为1的消息”]
} ],
“总点击数”:1
}
正如您所看到的,“h_message”以数组的形式出现,我试图得到的是一个字符串/值
"h_message" : [ "some message with the <em>number</em> <em>1</em>" ]
“h_消息”:[“数字为1的消息”]
解决了它
[
{
"operation": "shift",
"spec": {
"took": "took",
"hits": {
"total": "total_hits",
"hits": {
"*": {
"_source": {
"user": "Response[&2].firstName"
},
"highlight": {
"message": {
"*": "Response[&0].h_message"
}
}
}
}
}
}
}
]
"h_message" : [ "some message with the <em>number</em> <em>1</em>" ]
[
{
"operation": "shift",
"spec": {
"took": "took",
"hits": {
"total": "total_hits",
"hits": {
"*": {
"_source": {
"user": "Response[&2].firstName"
},
"highlight": {
"message": {
"*": "Response[&0].h_message"
}
}
}
}
}
}
}
]