The Kibana user interface allows the user to create a script field that is stored as part of the index (screenshot below). How can this be done programmatically? In particular, using either the NEST client or the low-level Elasticsearch client.
Kibana tab for display with the Script tab highlighted
Please note that I am not asking how to create the addition of an expression / script field as part of the query, I am specifically looking for how to add it as part of the Index when creating the mapping, so that queries can reference it without specifying it explicitly.
Kibana .kibana. , Kibana, . , curl -XGET http://localhost:9200/.kibana/_search?type=dashboard&pretty JSON . , JSON, POST. Kibana Elasticsearch, Elasticsearch API Kibana. .
curl -XGET http://localhost:9200/.kibana/_search?type=dashboard&pretty
5.2 .
:
_source.fields ( , )
"fields":"[...,{\"name\":\"test\",\"type\":\"number\",\"count\":0,\"scripted\":true,\"script\":\"doc['area_id'].value\",\"lang\":\"painless\",\"indexed\":false,\"analyzed\":false,\"doc_values\":false,\"searchable\":true,\"aggregatable\":true}]"
_source json /.kibana/index-pattern/YOUR_INDEX
{ "title":"YOUR_INDEX", "timeFieldName":"time", "fields":"[...,{\"name\":\"test\",...}]" }
Source: https://habr.com/ru/post/1655748/More articles:Show inbox dialog for non-users like Allo - androidВызов диалога из другого класса - androidPython - tf-idf predicts new document similarity - pythonИспользование хэш-функции F # внутри GetHashCode() зло? - equalityFailed to load Excel spreadsheet with output data from backend - angularjsWhat are the differences between Scala s inner classes and Javas inner / nested classes? - javaRacket macro that defines several top-level forms? - macrosЗагрузка внешнего тега script в компонент реакции - domConvert float to int and leave null - pythonWhy doesn't sync work properly in this code? - javaAll Articles