Convert string to integer

"hour": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },

The problem is it is reading the heading 'hour' as a result it converts entire field to text.
I created ingest pipeline to convert str to int and reindex but unfortunately it always gives error like "type" : "number_format_exception", "reason" : "for input string: "hour""