Multisearch API in Elasticsearch v5 / v6 using Java Client

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)?

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

Thanks for any help offered.

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?

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

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...

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.

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...?

Restore in the documentation means Snapshot and Restore feature. 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

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.

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

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