# Multisearch API in Elasticsearch v5 / v6 using Java Client

**URL:** <https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243>\
**Category:** Elasticsearch\
**Created:** [November 26, 2018, 8:57pm UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243 "2018-11-26T20:57:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [November 26, 2018, 8:57pm UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/1 "2018-11-26T20:57:31Z")

</div>

I'm currently upgrading our elasticsearch from v2.3.4 to v5.6 and then v6.x.

I'm starting to use the RestHighLevelClient and want to execute a MultiSearchRequest. How can I do this RestHighLevelClient in v5? It looks like the documentation only covers v7 ([https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high-multi-search.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high-multi-search.html))?

Is this something I have to do via the low level api in these versions?

Thanks for any help offered.

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [November 27, 2018, 10:21am UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/2 "2018-11-27T10:21:36Z")

</div>

I don't understand. There's a MultiSearchRequest and a MultiSearchResponse but no way of executing a request to get a response via the RestHighLevelClient?

So do I need to use the low level client, or revert to using the TransportClient?

---

<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:** [November 27, 2018, 10:44am UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/3 "2018-11-27T10:44:20Z")

</div>

You should better move directly to 6.x IMO.  
But for now, you can indeed call the Low Level client.

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [November 27, 2018, 10:58am UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/4 "2018-11-27T10:58:18Z")

</div>

Ok, thanks! We are moving to 6.x, but 6.x won't read indices created in 2.x. So I need to move to the latest version of 5.x, reindex the data, then snapshot and restore onto 6.x..., and there are some other things I need to do that involve no-downtime for users etc. It's complicated, but basically, users may have to query from the 5.x cluster at some point, hence using the 5.x client.

I am tempted to do something else though to prevent that and move them straight to 6...

---

<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:** [November 27, 2018, 11:22am UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/5 "2018-11-27T11:22:46Z")

</div>

How are you going to move from 2.x to 5.x without any downtime?

I don't know what are the implications for you but my recommendation is to move to 6.5.1 directly if possible.  
If possible, I'd:

- create a brand new 6.5 cluster
- use the reindex API to read from 2.x and index into 6.x
- Switch the application to 6.x (using 6.x HLClient)
- Delete the 2.x cluster

My 0.05 cents.

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [November 27, 2018, 11:33am UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/6 "2018-11-27T11:33:52Z")

</div>

Do you mean do reindexing over the wire? Wouldn't it be faster to reindex on disk?  
I'm assuming this is what you mean because the documentation specifically states that you cannot restore a v2 snapshot to a v6 cluster...?

---

<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:** [November 27, 2018, 12:11pm UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/7 "2018-11-27T12:11:47Z")

</div>

Restore in the documentation means [Snapshot and Restore feature](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html). Which indeed can not work from 2.x indices in a 6.x cluster.

I'm speaking about reindex API. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-from-remote](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-from-remote)

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [November 27, 2018, 12:20pm UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/8 "2018-11-27T12:20:28Z")

</div>

Sure, but given that it's going to take \> 3 weeks on a 9-node cluster to reindex the data when its co-located on disk, then I feel that doing it across the wire is a bad idea...? Am I wrong?

Especially when users are currently hitting the v2 cluster with gusto.

---

<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:** [November 27, 2018, 12:42pm UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/9 "2018-11-27T12:42:26Z")

</div>

I don't know. You have to test it.

---

<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:** [December 25, 2018, 12:42pm UTC](https://discuss.elastic.co/t/multisearch-api-in-elasticsearch-v5-v6-using-java-client/158243/10 "2018-12-25T12:42:28Z")

</div>

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