# Problem with the namespace

**URL:** <https://discuss.elastic.co/t/problem-with-the-namespace/87647>\
**Category:** Elasticsearch\
**Created:** [May 30, 2017, 10:57pm UTC](https://discuss.elastic.co/t/problem-with-the-namespace/87647 "2017-05-30T22:57:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MountainMoon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mountainmoon/32/125700_2.png) [@MountainMoon](https://discuss.elastic.co/u/MountainMoon)\
**Post date:** [May 30, 2017, 10:57pm UTC](https://discuss.elastic.co/t/problem-with-the-namespace/87647/1 "2017-05-30T22:57:50Z")

</div>

I've got a project which uses ES2.x currently. And I'm upgrading it to ES5.x. But I got a problem with the namespace. I could not use both NEST 2.0.0 and NEST 5.0.0 at the same time in one project. So I download the source code and change the namespace for NEST 5.x and [Elasticsearch.net](http://Elasticsearch.net) 5.x to NEST5 and Elasticsearch.NET5. But after when i use the compiled .dll files in the project. It could not do any mapping to the index. And throws out something like the following:  
Invalid NEST response built from a unsuccessful low level call on PUT: /reviewsearch\_v1# Audit trail of this API call: - [1] BadResponse: Took: 00:00:00.3499997# ServerError: ServerError: 400Type: mapper\_parsing\_exception Reason: "Failed to parse mapping [reviews]: No handler for type [{name=long}] declared on field [zidReviewId]" CausedBy: "Type: mapper\_parsing\_exception Reason: "No handler for type [{name=long}] declared on field [zidReviewId]""# OriginalException: System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Elasticsearch.Net5.HttpConnection.Request[TReturn](RequestData requestData)#  
Any idea will be appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 31, 2017, 7:28am UTC](https://discuss.elastic.co/t/problem-with-the-namespace/87647/2 "2017-05-31T07:28:07Z")

</div>

Perhaps if you can show your code it will help us?

---

<div class="post-metadata">

**Author:** ![MountainMoon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mountainmoon/32/125700_2.png) [@MountainMoon](https://discuss.elastic.co/u/MountainMoon)\
**Post date:** [May 31, 2017, 8:32pm UTC](https://discuss.elastic.co/t/problem-with-the-namespace/87647/3 "2017-05-31T20:32:41Z")

</div>

**Hi warkolm , here is the function I use to create mappings**  
protected void CreateIndex()  
{  
var createResponse = Client.CreateIndex("reviewsearch\_v1", cis =\> cis  
.Mappings(ms =\> ms.Map(m =\> m.AutoMap())));  
}  
**And I tried to get the failed request as below:**  
{  
"mappings":{  
"reviews":{  
"properties":{  
"zidReviewId":{  
"type":{  
"name":"long"  
},  
"doc\_values":true  
},  
"chvProductType":{  
"type":{  
"name":"keyword"  
},  
"doc\_values":true  
}  
}  
}  
}  
}

**Vs the correct request:**  
{  
"mappings":{  
"reviews":{  
"properties":{  
"zidReviewId":{  
"type":"long",  
"doc\_values":true  
},  
"chvProductType":{  
"type":"keyword",  
"doc\_values":true  
}  
}  
}  
}  
}  
**It seems that the failed request put a "name" under "type". Do you have any idea why is that?**  
**Add the document class.**  
[ElasticsearchType(  
Name = "reviews",  
IdProperty = "zidReviewId"  
)]  
public class ReviewSearchDocument  
{  
[Number(NumberType.Long, DocValues = true)]  
public long zidReviewId { get; set; }  
[Keyword(DocValues = true)]  
public string chvProductType { get; set; }  
}

---

<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:** [June 28, 2017, 8:33pm UTC](https://discuss.elastic.co/t/problem-with-the-namespace/87647/4 "2017-06-28T20:33:16Z")

</div>

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