I try other things :
Test 1 (Kibana script field):
return [
"doc['processContext.componentName'] = " + doc['processContext.componentName'],
"doc['processContext.componentName'].value = " + doc['processContext.componentName'].value,
"doc['processContext.componentName'].length = " + doc['processContext.componentName'].length,
""TOTO" ==~ /IN/ = " + ("TOTO" ==~ /IN/),
""IN_TOTO" ==~ /IN/ = " + ("IN_TOTO" ==~ /IN.*/)
];
Works with this result :
doc['processContext.componentName'] = [IN_Ret], doc['processContext.componentName'].value = IN_Ret, doc['processContext.componentName'].length = 1, "TOTO" ==~ /IN/ = false, "IN_TOTO" ==~ /IN/ = true
Test 2 (Kibana script field):
return [
"doc['processContext.componentName'] = " + doc['processContext.componentName'],
"doc['processContext.componentName'].value = " + doc['processContext.componentName'].value,
"doc['processContext.componentName'].length = " + doc['processContext.componentName'].length,
""TOTO" ==~ /IN/ = " + ("TOTO" ==~ /IN/),
""IN_TOTO" ==~ /IN/ = " + ("IN_TOTO" ==~ /IN./),
"doc['processContext.componentName'].value ==~ /IN/ = " + (**doc['processContext.componentName'].value ==~ /IN./**)
];
Don't work, same Kibana error "Courier Fetch: 1 of 5 shards failed". Nothing in elasticsearch or kibana logs
Test 3 (Kibana Dev Console):
GET test-/_search
{
"query": {
"match_all": {}
},
"script_fields" : {
"test1" : {
"script" : {
"lang": "painless",
"inline": "return **doc['processContext.componentName'].value ==~ /IN./**"
} } }}
Works with this result :
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 998,
"max_score": 1,
"hits": [
{
"_index": "test-2017-03",
"_type": "step",
"_id": "AVsVAHiaaDmnhEi3LNvC",
"_score": 1,
"fields": {
"test1": [
false
] } }, ....
Test 4 (Add the script fields in a saved search):
Trying to add the script fields directly in the kibanaSavedObjectMeta.searchSourceJSON of a saved search
Don't work when we try to open this search in kibana. Same Kibana error "Courier Fetch: 1 of 5 shards failed". Nothing in elasticsearch or kibana logs
Thank you for your help,