# How do I have to migrate the usage of org.elasticsearch.\* multiSearchResponse to co.elastic.\* MsearchResponse?

**URL:** <https://discuss.elastic.co/t/how-do-i-have-to-migrate-the-usage-of-org-elasticsearch-multisearchresponse-to-co-elastic-msearchresponse/344081>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 28, 2023, 3:52pm UTC](https://discuss.elastic.co/t/how-do-i-have-to-migrate-the-usage-of-org-elasticsearch-multisearchresponse-to-co-elastic-msearchresponse/344081 "2023-09-28T15:52:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![du-it](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@du-it](https://discuss.elastic.co/u/du-it)\
**Post date:** [September 28, 2023, 3:52pm UTC](https://discuss.elastic.co/t/how-do-i-have-to-migrate-the-usage-of-org-elasticsearch-multisearchresponse-to-co-elastic-msearchresponse/344081/1 "2023-09-28T15:52:16Z")

</div>

I am migrating from org.elasticsearch.\* to co.elastic.\* classes using elasticsearch-java dependency 8.10.2.  
It's really not obvious which co.elastic.\* classes are the org.elasticsearvh.\* equivalent when replacing the RestHighLevelClient with the new Java Api Client (low-level).  
In the past I used

```auto
MultiSearchResponse multiSearchResponse =
        elasticsearchClient.execute(MultiSearchAction.INSTANCE, multiSearchRequest).actionGet();

```

and afterwards I coould handle the SearchResponse.  
How do I have to refactor it using the ElasticsearchClient?  
From

```auto
MsearchResponse<Article> multiSearchResponse =
            elasticsearchClient.msearch(multiSearchRequest, Article.class);

```

I am not able anymore to get SearchResponse objects from. instead, I can get a MultiSearchItem by:  
`MultiSearchItem msi = multiSearchResponse.responses().get(0).result();` (Simplified access.)  
...but I am not able anymore to get a `SearchResponse` object to work upon although a `SearchResponse` class exists in co.elastic.\*  
This all is confusing.

---

<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:** [October 26, 2023, 3:52pm UTC](https://discuss.elastic.co/t/how-do-i-have-to-migrate-the-usage-of-org-elasticsearch-multisearchresponse-to-co-elastic-msearchresponse/344081/2 "2023-10-26T15:52:37Z")

</div>

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