Script processor not adding a new field using ingest pipeline

I am trying to compare values with already data already indexed with some user input values
through script processor,
script is running successfully but its not creating a new field which actually stores the result.

	  "script": {
    "source": """
      if (!ctx.containsKey('manager-list.keyword') || ctx['manager-list.keyword'].size() == 0) {
if (ctx.containsKey('manager-list.keyword')) {
def managerName = ctx['manager-list.keyword'].value;
      def givenValues = ['', ''];
      for (String value : givenValues) {
        if (managerName == value) {
          ctx.result = value;
  "lang": "painless"

I want to store the output in a field so I guess result variable would be added as new field but it's not working.

After that I am running update_by_query to update the data. but no success
could you please check.

Could you please check why its not creating a new field 'result'