# Elastic as an adhoc query engine

**URL:** <https://discuss.elastic.co/t/elastic-as-an-adhoc-query-engine/152877>\
**Category:** Elasticsearch\
**Created:** [October 17, 2018, 4:34pm UTC](https://discuss.elastic.co/t/elastic-as-an-adhoc-query-engine/152877 "2018-10-17T16:34:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carl\_Christianson](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Carl\_Christianson](https://discuss.elastic.co/u/Carl_Christianson)\
**Post date:** [October 17, 2018, 4:34pm UTC](https://discuss.elastic.co/t/elastic-as-an-adhoc-query-engine/152877/1 "2018-10-17T16:34:55Z")

</div>

So I am noodling different ideas to transform an application that I run. At a high level, I need to be able to support an adhoc query based on a wide range of criteria, and then be able to return back a data set of ID's that will be crammed into a table to be used down stream. So row size is really small, but it could potentially be millions of rows. Currently this is done in a RDBMS and depending on the criteria, and so on it can be quite the sql statement and can be extremely resource intensive.

What _I_ am wondering is this. Could Elasticsearch be used to solve this. Can I use some combo out of this stack to perform an adhoc search (I mean what is an adhoc query other then an adhoc search anyway). The trick is I need to get back the entire result set, if paginated the page size would have to be able to be huge. So if anyone here has done something similar, or has some suggestions on where to look I'm all ears.  
--tx

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 18, 2018, 7:32am UTC](https://discuss.elastic.co/t/elastic-as-an-adhoc-query-engine/152877/2 "2018-10-18T07:32:43Z")

</div>

Have you taken a look at [scroll searches](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/search-request-scroll.html), a point in time snapshot that you can paginate through? Would that work in this case?

--Alex

---

<div class="post-metadata">

**Author:** ![Carl\_Christianson](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Carl\_Christianson](https://discuss.elastic.co/u/Carl_Christianson)\
**Post date:** [October 18, 2018, 2:39pm UTC](https://discuss.elastic.co/t/elastic-as-an-adhoc-query-engine/152877/3 "2018-10-18T14:39:51Z")

</div>

Scroll does look like it might do what I need. I'm just wondering if anyone here has done something along the lines of what I would like to do. I'd rather not go do a journey of discovery off the edge of the world 😃

---

<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:** [November 15, 2018, 2:53pm UTC](https://discuss.elastic.co/t/elastic-as-an-adhoc-query-engine/152877/4 "2018-11-15T14:53:51Z")

</div>

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