Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定以下Foo存储在 ElasticSearch 索引中的条目:
Foo
"Foo": { "x":"500", "y":"200" }
X在 Kibana 中创建一个将和Y值相加的 sripted 字段的正确语法是什么?
X
Y
如果您按如下方式索引文档
PUT scripted/doc/1 { "Foo": { "x":500, "y":200 } }
然后在脚本字段中总结字段的语法是:
doc['Foo.x'].value + doc['Foo.y'].value
和x字段y必须是数字字段。如果将它们索引为字符串,则在尝试评估脚本字段时会出错。
x
y