In scripted fields avoid No field found for [] in mapping with types

Sorry, that also results in the same error. This should work instead:

if (doc.containsKey('x.keyword')) {
  return doc['x.keyword'].value;
} else {
  return '';
}
6 Likes