# Are the mapper attachment plugin and the IndicesService class compatible with a TransportClient?

**URL:** <https://discuss.elastic.co/t/are-the-mapper-attachment-plugin-and-the-indicesservice-class-compatible-with-a-transportclient/39115>\
**Category:** Elasticsearch\
**Created:** [January 13, 2016, 2:12pm UTC](https://discuss.elastic.co/t/are-the-mapper-attachment-plugin-and-the-indicesservice-class-compatible-with-a-transportclient/39115 "2016-01-13T14:12:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cocote](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@cocote](https://discuss.elastic.co/u/cocote)\
**Post date:** [January 13, 2016, 2:12pm UTC](https://discuss.elastic.co/t/are-the-mapper-attachment-plugin-and-the-indicesservice-class-compatible-with-a-transportclient/39115/1 "2016-01-13T14:12:02Z")

</div>

Hello,

I've been using ElasticSearch 2.1 and the Java API for a few weeks now and it went fine so far. I'm now trying to use the mapper attachment plugin to index the content of some files. I browsed the ES repository and looked at the test classes. I found one that suits my needs: `elasticsearch/core/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java` (branch 2.1) but I haven't been able to make it work with a TransportClient.

My problem stands with this unique line that every test case starts with:

`IndexService indexService = createIndex("test");`

The createIndex() method refers to this class `elasticsearch/core/src/test/java/org/elasticsearch/test/ESSingleNodeTestCase.java` which uses a Node client.

I may not exactly understand what the IndexService class stands for and I apologize if my question is oblivious but here it is.

Can a TransportClient have the same kind of access to the IndicesService as the Node Client? If so, could you tell me how? If not, is there any class other than IndicesService/IndexService I could use to get a proper `DocumentMapperParser` in case of a TransportNode? Any enlightenment would be appreciated.

Thank you!

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 15, 2016, 8:09pm UTC](https://discuss.elastic.co/t/are-the-mapper-attachment-plugin-and-the-indicesservice-class-compatible-with-a-transportclient/39115/2 "2016-01-15T20:09:04Z")

</div>

Maybe some quick notes.

The design of ES code is a little bit mixed up. Client code and server-only code depend on each other. Because of this, services which are server-only, like IndexService, live side by side with services which can be used by a NodeClient, or a TransportClient.

IndexService provides methods for maintaining index data, which is kept in data nodes, and is never at client side, i.e. NodeClient, or a TransportClient.

You have to study the code to learn more about the modules and services. They are instantiated by injection (a guice-like ModuleBuilder) and you will notice that a server-side node will ramp up much more services, including cluster management, index analysis, and so on, while clients only instantiate network services, and thread pools.

In a TransportClient, you will not have access to cluster state, or indices.

Regarding the mapper attachment plugin, it lives on server-side only, and can not be used by a TransportClient.

---

<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:** [July 5, 2017, 11:24pm UTC](https://discuss.elastic.co/t/are-the-mapper-attachment-plugin-and-the-indicesservice-class-compatible-with-a-transportclient/39115/3 "2017-07-05T23:24:00Z")

</div>


