/// <summary>
        /// Get a Put Index Template Descriptor for use with <see cref="Nest.PutIndexTemplateRequest"/>
        /// designed for use with Elastic Common Schema version 1.3.0
        /// </summary>
        /// <param name="name">The name of the index template.</param>
        /// <returns>An instance of <see cref="Nest.PutIndexTemplateDescriptor"/>.</returns>
        public static PutIndexTemplateDescriptor GetIndexTemplate(Name name)
        {
            var indexTemplate = new PutIndexTemplateDescriptor(name);

            indexTemplate.IndexPatterns("ecs-*");
            indexTemplate.Order(1);
            indexTemplate.Settings(s =>
                                   s.Setting("index",
                                             new
            {
                refresh_interval = "5s",
                mapping          = new
                {
                    total_fields = new
                    {
                        limit = 100000
                    }
                }
            }));

            indexTemplate.Map(GetTypeMappingDescriptor());

            return(indexTemplate);
        }
Exemplo n.º 2
0
 protected IPutIndexTemplateRequest PutFluent(string name, PutIndexTemplateDescriptor d) => d
 .IndexPatterns("startingwiththis-*")
 .Settings(s => s
           .NumberOfShards(1)
           );
 private IPutIndexTemplateRequest CreateFluent(string name, PutIndexTemplateDescriptor d) => d
 .IndexPatterns("startingwiththis-*")
 .Settings(s => s
           .NumberOfShards(2)
           );