# Is there a way to convert an Elasticsearch query to its Lucene equivalent?

**URL:** https://discuss.elastic.co/t/is-there-a-way-to-convert-an-elasticsearch-query-to-its-lucene-equivalent/77020
**Category:** Elasticsearch
**Created:** [March 1, 2017, 4:17pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-convert-an-elasticsearch-query-to-its-lucene-equivalent/77020 "2017-03-01T16:17:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin\_Bourne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_bourne/32/53053_2.png) [@Kevin\_Bourne](https://discuss.elastic.co/u/Kevin_Bourne)
#### Post date: [March 1, 2017, 4:17pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-convert-an-elasticsearch-query-to-its-lucene-equivalent/77020/1 "2017-03-01T16:17:25Z")

</div>

I have an existing parser that will properly parse a Lucene query into the data objects I need. I would like to reuse this code if possible as opposed to writing a new parser.

Is there a way to take an existing Elasticsearch JSON query and get back the equivalent Lucene query? I know this seems backwards but as I said, it would allow me to reuse existing code.

I am using ES 2.3.3 and the ES Java Api and Jest API.

---

<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 29, 2017, 4:17pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-convert-an-elasticsearch-query-to-its-lucene-equivalent/77020/2 "2017-03-29T16:17:47Z")

</div>

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