# Can I converting a QueryBuilder to lucene syntax string?

**URL:** <https://discuss.elastic.co/t/can-i-converting-a-querybuilder-to-lucene-syntax-string/6779>\
**Category:** Elasticsearch\
**Created:** [February 22, 2012, 8:06am UTC](https://discuss.elastic.co/t/can-i-converting-a-querybuilder-to-lucene-syntax-string/6779 "2012-02-22T08:06:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yin\_weifeng](https://avatars.discourse-cdn.com/v4/letter/y/f4b2a3/32.png) [@yin\_weifeng](https://discuss.elastic.co/u/yin_weifeng)\
**Post date:** [February 22, 2012, 8:06am UTC](https://discuss.elastic.co/t/can-i-converting-a-querybuilder-to-lucene-syntax-string/6779/1 "2012-02-22T08:06:22Z")

</div>

I want to serialized a QueryBuiler ,but if using JSON , it will be  
difficult to understand.

so I want using the lucene query parser syntax .

so how can i serialized it to lucene query parser syntax, is ES already  
have such API?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 26, 2012, 9:37am UTC](https://discuss.elastic.co/t/can-i-converting-a-querybuilder-to-lucene-syntax-string/6779/2 "2012-02-26T09:37:37Z")

</div>

You can't serialize the result of QueryBuilder into a Lucene query parser syntax, it either using json, or building yourself the lucene query string.

On Wednesday, February 22, 2012 at 10:06 AM, 殷伟峰 wrote:

> I want to serialized a QueryBuiler ,but if using JSON , it will be difficult to understand.
> 
> so I want using the lucene query parser syntax .
> 
> so how can i serialized it to lucene query parser syntax, is ES already have such 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:** [July 6, 2017, 3:38am UTC](https://discuss.elastic.co/t/can-i-converting-a-querybuilder-to-lucene-syntax-string/6779/3 "2017-07-06T03:38:18Z")

</div>


