# Querying already indexed data in different computer

**URL:** <https://discuss.elastic.co/t/querying-already-indexed-data-in-different-computer/1077>\
**Category:** Elasticsearch\
**Created:** [May 21, 2015, 10:59am UTC](https://discuss.elastic.co/t/querying-already-indexed-data-in-different-computer/1077 "2015-05-21T10:59:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kartik\_Singhal](https://avatars.discourse-cdn.com/v4/letter/k/439d5e/32.png) [@Kartik\_Singhal](https://discuss.elastic.co/u/Kartik_Singhal)\
**Post date:** [May 21, 2015, 10:59am UTC](https://discuss.elastic.co/t/querying-already-indexed-data-in-different-computer/1077/1 "2015-05-21T10:59:23Z")

</div>

In Elasticsearch java api, suppose I am building the indexed data using this client

> _Node node = nodeBuilder().clusterName("./resources/firstcommit").node();_  
> _Client client = node.client();_  
> _IndexResponse response = client.prepareIndex("twitter", "tweet", "1")_  
> _.setSource(jsonBuilder()_  
> _.startObject()_  
> _.field("user", "kimchy")_  
> _.field("postDate", new Date())_  
> _.field("message", "trying out Elasticsearch")_  
> _.endObject()_  
> _)_  
> _.execute()_  
> _.actionGet();_

This indexed data is stored in folder XYZ/resources/firstcommit.  
My question is how to query this indexed data in java on some other client on other computer.  
Is there any way in which I can give the path and the already indexed data can be imported, then I can perform queries on it?

I copied the whole data folder on other computer and ran the following code on other computer. This gave the following exception

> Node node = nodeBuilder().clusterName("./resources/firstcommit").node();  
> Client client = node.client();  
> MatchQueryBuilder qb = QueryBuilders.matchQuery("user", "kimchy");  
> SearchRequestBuilder srb = client.prepareSearch("twitter").setTypes("tweet");  
> SearchResponse big = srb.setQuery(qb).execute().actionGet();  
> SearchHit results = big.getHits().getHits();

This shows

search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed

---

<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 6, 2017, 12:12am UTC](https://discuss.elastic.co/t/querying-already-indexed-data-in-different-computer/1077/2 "2017-07-06T00:12:40Z")

</div>


