# Attibute mapping not working with 2 POCO classes es 5.5

**URL:** <https://discuss.elastic.co/t/attibute-mapping-not-working-with-2-poco-classes-es-5-5/98961>\
**Category:** Elasticsearch\
**Created:** [August 31, 2017, 8:01am UTC](https://discuss.elastic.co/t/attibute-mapping-not-working-with-2-poco-classes-es-5-5/98961 "2017-08-31T08:01:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravi\_Randev\_Singh](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Ravi\_Randev\_Singh](https://discuss.elastic.co/u/Ravi_Randev_Singh)\
**Post date:** [August 31, 2017, 8:01am UTC](https://discuss.elastic.co/t/attibute-mapping-not-working-with-2-poco-classes-es-5-5/98961/1 "2017-08-31T08:01:42Z")

</div>

Hi Everyone,

I have a case where index has 2 type and i am using nest to create index with the help of attribute mapping.  
The attribute mapping works fine when i used it with 1 poco class as soon as i add another poco class it dosen't map the properties with attribute as desired for eg

CLass1::

[keyword]  
public int prop1{get; set;} // works fine if i only use this class to map to a index

CLass2::

public int prop2{get; set;}

Now when i try to create a index it will not create mapping as desired ::  
When using class1 only mapping will be:  
"prop1" : {  
"type" : "keyword"  
}

When using class1 & class2 mapping will be:  
"prop1" : {  
"type" : "long"  
}

code i am using to create index

esConnection.CreateIndex("index", c =\> c  
.InitializeUsing(indexConfig)  
.Mappings(m =\> m.Map(x =\> x.AutoMap())  
.Map(x =\> x.AutoMap())  
)  
);

Any help would be appreciated.

---

<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:** [September 28, 2017, 8:01am UTC](https://discuss.elastic.co/t/attibute-mapping-not-working-with-2-poco-classes-es-5-5/98961/2 "2017-09-28T08:01:50Z")

</div>

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