我正在尝试使用Percolator并且不仅检索perculator id而且检索整个原始查询.
这是我的查询:
curl -XPUT 'localhost:9200/my-index/.percolator/1' -d '{
"query" : {
"match" : {
"message" : "bonsai tree"
}
},
"moreInfo": {
"foo": "bar"
}
}'
Run Code Online (Sandbox Code Playgroud)
找到匹配的文档后,我得到了这个:
{
"took" : 19,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"total" : 1,
"matches" : [
{
"_index" : "my-index",
"_id" : "1"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我真正感兴趣的是moreInfo查询的一部分.我知道我可以在一个额外的请求中查询elasticsearch,但直接拥有它会很棒,如下所示:
{
"took" : 19,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
}, …Run Code Online (Sandbox Code Playgroud)