# What is the "setTypes" method of TransportClient Object?

**URL:** <https://discuss.elastic.co/t/what-is-the-settypes-method-of-transportclient-object/231272>\
**Category:** Elasticsearch\
**Created:** [May 6, 2020, 6:08am UTC](https://discuss.elastic.co/t/what-is-the-settypes-method-of-transportclient-object/231272 "2020-05-06T06:08:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhir83](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@abhir83](https://discuss.elastic.co/u/abhir83)\
**Post date:** [May 6, 2020, 6:08am UTC](https://discuss.elastic.co/t/what-is-the-settypes-method-of-transportclient-object/231272/1 "2020-05-06T06:08:48Z")

</div>

Hello Friends,

```auto
What is the "setTypes" method of TransportClient Object?

//Code Line Here
client.prepareSearch(this.index).setTypes("datum") '''---->What is "datum" here?

```

Thanks....

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 6, 2020, 10:15am UTC](https://discuss.elastic.co/t/what-is-the-settypes-method-of-transportclient-object/231272/2 "2020-05-06T10:15:00Z")

</div>

It's the mapping name or type name. It should be usually set by default to `_doc`.

But... Don't use the TransportClient as [it is deprecated](https://www.elastic.co/guide/en/elasticsearch/client/java-api/7.6/transport-client.html) and will be removed in the next major version. Use the [REST Client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.6/index.html) instead.

---

<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 3, 2020, 10:15am UTC](https://discuss.elastic.co/t/what-is-the-settypes-method-of-transportclient-object/231272/3 "2020-06-03T10:15:01Z")

</div>

Closed on June 3, 2020, 10:15am UTC

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