   try types.push(t) for t of HTTP.call('GET', url + '/' + index + '/_mapping').data[index].mappings
   return types
 
-API.es.call = (action, route, data, refresh, versioned, scan, scroll='1m', url=API.settings.es.url) ->
+API.es.call = (action, route, data, refresh, versioned, scan, scroll='5m', url=API.settings.es.url) ->
   url = url[Math.floor(Math.random()*url.length)] if Array.isArray url
   route = '/' + route if route.indexOf('/') isnt 0
   return false if action is 'DELETE' and route.indexOf('/_all') is 0 # disallow delete all

      try
        try nim = RetryHttp.call 'PUT', tourl + '/' + toindex, {retry:API.es._retries} # will fail if index still exists, but that is OK
        nitm = RetryHttp.call 'PUT', tourl + '/' + toindex + '/_mapping/' + totype, {data: mapping, retry:API.es._retries}
        ret = RetryHttp.call 'POST', tourl + '/' + intermediate + toindex + '/' + totype + '/_search?search_type=scan&scroll=1m', {data:{query: { match_all: {} }, size: 10000 }, retry:API.es._retries}
        if ret.data?._scroll_id?
          res = RetryHttp.call 'GET', tourl + '/_search/scroll?scroll=1m&scroll_id=' + ret.data._scroll_id, {retry:API.es._retries}
          while (res?.data?.hits?.hits? and res.data.hits.hits.length)
            pkg = ''
            for row in res.data.hits.hits

            hp = RetryHttp.call 'POST', tourl + '/_bulk', {content:pkg, headers:{'Content-Type':'text/plain'},retry:API.es._retries}
            try refreshed = RetryHttp.call 'POST', tourl + '/' + toindex + '/_refresh', {retry:API.es._retries}
            pkg = ''
            res = RetryHttp.call 'GET', tourl + '/_search/scroll?scroll=' + scroll + '&scroll_id=' + res.data._scroll_id, {retry:API.es._retries}
        deleted_temp = RetryHttp.call 'DELETE', tourl + '/' + intermediate + toindex, {retry:API.es._retries}
        API.log {msg: 'Reindexed ' + index + ' ' + type + ' with ' + processed + ' records, to ' + tourl + '/' + toindex + '/' + totype + ' with intermediate index at ' + intermediate + toindex, level:'warn', notify:true}
      catch err
        processed = false
        API.log {msg: 'Reindex failed at recreate step for ' + index + ' ' + type, level:'warn', notify:true, error: err}
