# Template defining makes the elasticsearch slower

**URL:** https://discuss.elastic.co/t/template-defining-makes-the-elasticsearch-slower/182306
**Category:** Elasticsearch
**Created:** [May 22, 2019, 6:57pm UTC](https://discuss.elastic.co/t/template-defining-makes-the-elasticsearch-slower/182306 "2019-05-22T18:57:18Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)
#### Post date: [May 22, 2019, 7:03pm UTC](https://discuss.elastic.co/t/template-defining-makes-the-elasticsearch-slower/182306/5 "2019-05-22T19:03:04Z")

</div>

```
 "PDur" : {
    "type" : "integer"
  },
  "PSe" : {
    "type" : "keyword"
  },
  "QuWa" : {
    "type" : "integer"
  },
  "RspNo" : {
    "type" : "keyword"
  },
  "RspStr" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 256
      }
    }
  },
  "SRec" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        } },
  "SSe" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        } },
  "SSWa" : {
    "type" : "integer"
  },
  "SeSer" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 256
      }
    }
  },
  "SIP" : {
    "type" : "ip"
  },
  "SPort" : {
    "type" : "integer"
  },
  "State" : {
    "type" : "keyword"
  },
  "TCPS" : {
    "type" : "integer"
  },
  "Terminal" : {
    "type" : "keyword"
  },
  "ThreadIdx" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 256
      }
    }
  },
  "Time" : {
    "type" : "keyword"
  },
  "TrCo" : {
    "type" : "keyword"
  },
  "User" : {
    "type" : "keyword"
  },
  "beat" : {
    "type" : "object"
  },
  "fields" : {
    "properties" : {
      "log_type" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        }
      }
    }
  },
  "host" : {
    "properties" : {
      "architecture" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        }
      },
      "id" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        }
      },
      "name" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        }
      },
      "os" : {
        "properties" : {
          "build" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "family" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "name" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "platform" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "version" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          }
        }
      }
    }
  },
  "input" : {
    "properties" : {
      "type" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        }
      }
    }
  },
  "log" : {
    "properties" : {
      "file" : {
        "properties" : {
          "path" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          }
        }
      }
    }
  },
  "offset" : {
    "type" : "long"
  },
  "prospector" : {
    "properties" : {
      "type" : {
        "type" : "text",
        "fields" : {
          "keyword" : {
            "type" : "keyword",
            "ignore_above" : 256
          }
        }
      }
    }
  },
  "source" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 256
      }
    }
  },
  "tags" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 256
      }
    }
  }
}
 }
}
  }

```

but, defining the new template makes the elasticsearch indexing process slower, because using the first template ( the default one elasticsearch created automatically) indexed 500000 records in 30 minutes but the second template ( which i defined ) indexed 300000 records in 30 minutes. could you please advise me about this? how can i promote the templates to make the indexing process faster?

---

_[View the full topic](https://discuss.elastic.co/t/template-defining-makes-the-elasticsearch-slower/182306)._
