# How to specify the index mapping in ESIntegTestCase?

**URL:** <https://discuss.elastic.co/t/how-to-specify-the-index-mapping-in-esintegtestcase/113278>\
**Category:** Elasticsearch\
**Created:** [December 27, 2017, 7:55am UTC](https://discuss.elastic.co/t/how-to-specify-the-index-mapping-in-esintegtestcase/113278 "2017-12-27T07:55:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vgindin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vgindin/32/42012_2.png) [@vgindin](https://discuss.elastic.co/u/vgindin)\
**Post date:** [December 27, 2017, 7:55am UTC](https://discuss.elastic.co/t/how-to-specify-the-index-mapping-in-esintegtestcase/113278/1 "2017-12-27T07:55:27Z")

</div>

Hi all.

I have a difficulty, described in

> [@The test gives different result from the real installation](https://discuss.elastic.co/t/the-test-gives-different-result-from-the-real-installation/113275):
>
> Hi all. I've written a simple plugin, that implements custom scoring logic and extending Explanation. I have some real index data that looks like this: "\_source": { "price": 10000, "params\_model": "Дверь задняя правая Honda CR-V", "categories": [ { "id": 3, "shop\_category\_id": "3", "name": "Кузов наружные элементы", "level": 1 }, { "id": 342, "shop\_category\_id": "62", "name": "Дверь …

I suppose that the reason is in mapping differences between the index created in my test and the real index in the real elasticsearch installation.

Could somebody tell me a way how to specify the index mapping in my test case (ESIntegTestCase)?

Regards,  
Vadim Gindin

---

<div class="post-metadata">

**Author:** ![vgindin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vgindin/32/42012_2.png) [@vgindin](https://discuss.elastic.co/u/vgindin)\
**Post date:** [December 27, 2017, 7:00pm UTC](https://discuss.elastic.co/t/how-to-specify-the-index-mapping-in-esintegtestcase/113278/2 "2017-12-27T19:00:39Z")

</div>

I've found the way. It is the use of CreateIndexRequestBuilder.addMapping(). The question about the index mapping in the integration test is closed.

---

<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:** [January 24, 2018, 7:01pm UTC](https://discuss.elastic.co/t/how-to-specify-the-index-mapping-in-esintegtestcase/113278/3 "2018-01-24T19:01:28Z")

</div>

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