# Create Index using NEST .NET

**URL:** <https://discuss.elastic.co/t/create-index-using-nest-net/71126>\
**Category:** Elasticsearch\
**Created:** [January 10, 2017, 5:21pm UTC](https://discuss.elastic.co/t/create-index-using-nest-net/71126 "2017-01-10T17:21:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![foonando](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@foonando](https://discuss.elastic.co/u/foonando)\
**Post date:** [January 10, 2017, 5:21pm UTC](https://discuss.elastic.co/t/create-index-using-nest-net/71126/1 "2017-01-10T17:21:21Z")

</div>

Hello Guys,

I have a doubt about how create index using NEST .NET. I created every fields in my C# method, however when i'll see the json created in elasticsearch the \_all field doesn't exists. Follow below the method, it's created the type in elasticsearch and the json got on elasticsearch. May someone help me, please?

C# Method(Partial Fields)  
private void CreateMappings()  
{  
\_client.Map(descriptor =\>  
{  
descriptor.Index(DefaultIndexName);

```
		descriptor.Properties(propertiesDescriptor =>
		{
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.id).Index(true).Type(NumberType.Long).IncludeInAll(true));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.id_Migracao).Index(true).Type(NumberType.Short).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.id_Loja).Index(true).Type(NumberType.Short).IncludeInAll(false));
			propertiesDescriptor.Text(prod => prod.Name(produto => produto.ds_Produto).IncludeInAll(true).Analyzer("brazilian").Fields(mf => mf.Text(vl => vl.Name(f => f.ds_Produto.Suffix("original")).IncludeInAll(false).Index(false))));
			propertiesDescriptor.Text(prod => prod.Name(produto => produto.cd_Produto).Index(true).IncludeInAll(true).Analyzer("brazilian"));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.id_Fabricante).Index(true).Type(NumberType.Integer).IncludeInAll(false));
			propertiesDescriptor.Text(prod => prod.Name(produto => produto.ds_Fabricante).Index(true).IncludeInAll(true).Analyzer("brazilian").Fields(mf => mf.Text(vl => vl.Name(f => f.ds_Produto.Suffix("original")).IncludeInAll(false).Index(false))));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.vr_Avaliacao).Index(true).Type(NumberType.Short).IncludeInAll(false));
			propertiesDescriptor.Boolean(prod => prod.Name(produto => produto.is_Disponivel).Index(true));
			propertiesDescriptor.Boolean(prod => prod.Name(produto => produto.is_Oferta).Index(true));
			propertiesDescriptor.Boolean(prod => prod.Name(produto => produto.is_ExibirSempre).Index(true));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.qt_Disponivel).Index(true).Type(NumberType.Integer).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.qt_Vendido).Index(true).Type(NumberType.Integer).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.id_Promocao).Index(true).Type(NumberType.Long).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.vr_PrecoPor).Index(true).Type(NumberType.Double).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.vr_PrecoDe).Index(true).Type(NumberType.Double).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.qt_Parcelas).Index(true).Type(NumberType.Short).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.vr_Parcelas).Index(true).Type(NumberType.Double).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.qt_ParcelasSemJuros).Index(true).Type(NumberType.Short).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.vr_ParcelasSemJuros).Index(true).Type(NumberType.Double).IncludeInAll(false));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.vr_TaxaJuros).Index(true).Type(NumberType.Double).IncludeInAll(false));
			propertiesDescriptor.Text(prod => prod.Name(produto => produto.ds_hierarquia_categoria).Index(false).IncludeInAll(false));
			propertiesDescriptor.Boolean(prod => prod.Name(produto => produto.is_FotoRotativa).Index(true));
			propertiesDescriptor.Number(prod => prod.Name(produto => produto.qtd_rotativa).Index(true).Type(NumberType.Integer).IncludeInAll(false));
			propertiesDescriptor.Boolean(prod => prod.Name(produto => produto.is_Disponibilidade).Index(true));
			propertiesDescriptor.Text(prod => prod.Name(produto => produto.guid_transacao).Index(true).IncludeInAll(false).Analyzer("brazilian"));
			
			return propertiesDescriptor;
		});
		return descriptor;
	});
}

```

JSON(Partial fields)  
{  
"fernando\_v02": {  
"mappings": {  
"produtos": {  
"properties": {  
"cd\_Produto": {  
"type": "text",  
"analyzer": "brazilian",  
"include\_in\_all": true  
},  
"ds\_Fabricante": {  
"type": "text",  
"fields": {  
"original": {  
"type": "text",  
"index": false,  
"include\_in\_all": false  
}  
},  
"analyzer": "brazilian",  
"include\_in\_all": true  
},  
"ds\_Produto": {  
"type": "text",  
"fields": {  
"original": {  
"type": "text",  
"index": false,  
"include\_in\_all": false  
}  
},  
"analyzer": "brazilian",  
"include\_in\_all": true  
},  
"ds\_UrlImagem": {  
"type": "text",  
"index": false,  
"include\_in\_all": false  
},  
"ds\_hierarquia\_categoria": {  
"type": "text",  
"index": false,  
"include\_in\_all": false  
},  
"dt\_Lancamento": {  
"type": "date",  
"include\_in\_all": false  
},  
"guid\_transacao": {  
"type": "text",  
"analyzer": "brazilian",  
"include\_in\_all": false  
},  
"id": {  
"type": "long",  
"include\_in\_all": true  
},....  
....  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 7, 2017, 5:21pm UTC](https://discuss.elastic.co/t/create-index-using-nest-net/71126/2 "2017-02-07T17:21:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
