# How to fetch data from elasticsearch without using id

**URL:** https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009
**Category:** Elasticsearch
**Created:** [February 6, 2017, 5:23am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009 "2017-02-06T05:23:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![srikanth](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@srikanth](https://discuss.elastic.co/u/srikanth)
#### Post date: [February 6, 2017, 5:23am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009/1 "2017-02-06T05:23:47Z")

</div>

I am using java REST client api to fetch data from elasticsearch. Here i am fetching data based on id ie, "twitter/tweet/1", but i want to retrieve all the records of that topic/endpoint. is there any way to get it?

---

<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: [February 6, 2017, 5:38am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009/2 "2017-02-06T05:38:54Z")

</div>

Run a search query.  
But use the scroll feature if you want to retrieve all docs.

---

<div class="post-metadata">

### Author: ![srikanth](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@srikanth](https://discuss.elastic.co/u/srikanth)
#### Post date: [February 6, 2017, 5:51am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009/3 "2017-02-06T05:51:13Z")

</div>

Hi David pilato,

```
Thank you for responding.i am sending a GET request and getting data based on id using REST Client. following is my request url:

```

GET [http://search-delivery-fleet-huzzphcdwqwjudhrutrstpwgbi.ap-southeast-1.es.amazonaws.com/truck2/truck2/d8e14a7d-5745-4538-8cb0-5cf312122688](http://search-delivery-fleet-huzzphcdwqwjudhrutrstpwgbi.ap-southeast-1.es.amazonaws.com/truck2/truck2/d8e14a7d-5745-4538-8cb0-5cf312122688)

can you please provide documentation link for running search query and using scroll feature.

---

<div class="post-metadata">

### Author: ![mohan\_s](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@mohan\_s](https://discuss.elastic.co/u/mohan_s)
#### Post date: [February 6, 2017, 6:21am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009/4 "2017-02-06T06:21:35Z")

</div>

Hi David,

[https://www.elastic.co/guide/en/elasticsearch/reference/current/\_introducing\_the\_query\_language.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/_introducing_the_query_language.html)

[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html)  
.

There are many supporting examples just goto documentation.

Regards

Mohan. S

---

<div class="post-metadata">

### Author: ![mohan\_s](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@mohan\_s](https://discuss.elastic.co/u/mohan_s)
#### Post date: [February 6, 2017, 6:22am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009/5 "2017-02-06T06:22:08Z")

</div>

Hi srikanth

[https://www.elastic.co/guide/en/elasticsearch/reference/](https://www.elastic.co/guide/en/elasticsearch/reference/)  
current/\_introducing\_the\_query\_language.html

[https://www.elastic.co/guide/en/elasticsearch/reference/](https://www.elastic.co/guide/en/elasticsearch/reference/)  
current/query-dsl.html.

There are many supporting examples just goto documentation.

Regards

---

<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: [March 6, 2017, 6:22am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-elasticsearch-without-using-id/74009/6 "2017-03-06T06:22:14Z")

</div>

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