# How to Validate elasticsearch queries

**URL:** <https://discuss.elastic.co/t/how-to-validate-elasticsearch-queries/251672>\
**Category:** Elasticsearch\
**Created:** [October 11, 2020, 10:23am UTC](https://discuss.elastic.co/t/how-to-validate-elasticsearch-queries/251672 "2020-10-11T10:23:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipack-v](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@dipack-v](https://discuss.elastic.co/u/dipack-v)\
**Post date:** [October 11, 2020, 10:23am UTC](https://discuss.elastic.co/t/how-to-validate-elasticsearch-queries/251672/1 "2020-10-11T10:23:39Z")

</div>

Hi,  
Is there any way to validate the queries created with QueryBuilders, For instance if we are using RDBMS, we can Embedded lightweight db to test the data layer. Is there anything similar in elasticsearch ?

---

<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:** [October 11, 2020, 1:55pm UTC](https://discuss.elastic.co/t/how-to-validate-elasticsearch-queries/251672/2 "2020-10-11T13:55:09Z")

</div>

You can not run elasticsearch embedded. Read this [blog post](https://www.elastic.co/blog/elasticsearch-the-server).

Note that to run integration tests (not unit tests) you would probably prefer running that in something close to a production environment, like a real elasticsearch server instance. I shared some ideas about integration testing in this thread: [In memory testing with RestHighLevelClient](https://discuss.elastic.co/t/in-memory-testing-with-resthighlevelclient/106196/6)

Also this sample project shows how to use Elasticsearch Test Classes:

> **[joel-costigliola/elastic-search-test](https://github.com/joel-costigliola/elastic-search-test)**
>
> ESIntegTestCase example. Contribute to joel-costigliola/elastic-search-test development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![dipack-v](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@dipack-v](https://discuss.elastic.co/u/dipack-v)\
**Post date:** [October 12, 2020, 1:30am UTC](https://discuss.elastic.co/t/how-to-validate-elasticsearch-queries/251672/3 "2020-10-12T01:30:37Z")

</div>

I'll have look, Thank you !

---

<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 9, 2020, 1:30am UTC](https://discuss.elastic.co/t/how-to-validate-elasticsearch-queries/251672/4 "2020-11-09T01:30:44Z")

</div>

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