# How to converting Lucene Query Parser Syntax to ElasticSearch Query DSL

**URL:** https://discuss.elastic.co/t/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726
**Category:** Elasticsearch
**Created:** [February 16, 2012, 7:01am UTC](https://discuss.elastic.co/t/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726 "2012-02-16T07:01:30Z")
**Posts on this page:** 6
**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 16, 2012, 7:01am UTC](https://discuss.elastic.co/t/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726/1 "2012-02-16T07:01:30Z")

</div>

I want to use the Lucene Query Parser Syntax to search in the ElasticSearch  
, how can I do

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [February 16, 2012, 7:05am UTC](https://discuss.elastic.co/t/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726/2 "2012-02-16T07:05:11Z")

</div>

You can use the query string query:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Hope this helps,

Ivan

On Wed, Feb 15, 2012 at 11:01 PM, 殷伟峰 [ywf1990@gmail.com](mailto:ywf1990@gmail.com) wrote:

> I want to use the Lucene Query Parser Syntax to search in the Elasticsearch  
> , how can I do

---

<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 16, 2012, 7:05am UTC](https://discuss.elastic.co/t/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726/3 "2012-02-16T07:05:39Z")

</div>

I think you can use QueryString

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

HTH  
David 😉  
@dadoonet

Le 16 févr. 2012 à 08:01, 殷伟峰 [ywf1990@gmail.com](mailto:ywf1990@gmail.com) a écrit :

> I want to use the Lucene Query Parser Syntax to search in the Elasticsearch , how can I do

---

<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, 6:33am UTC](https://discuss.elastic.co/t/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726/4 "2012-02-22T06:33:03Z")

</div>

Thanks for the point and links, those're very helpful.

and how to converting ElasticSearch Query DSL to Lucene Query Parser Syntax in java api?

like this:  
QueryBuilders.fieldQuery("field", "value") =\> field:"value"

---

<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 24, 2012, 1:33pm UTC](https://discuss.elastic.co/t/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726/5 "2012-02-24T13:33:36Z")

</div>

The field and query\_string queries value that you pass are parsed based on the Lucene query parser syntax.

On Wednesday, February 22, 2012 at 8:33 AM, yin weifeng wrote:

> Thanks for the point and links, those're very helpful.
> 
> and how to converting Elasticsearch Query DSL to Lucene Query Parser Syntax  
> in java api?
> 
> like this:  
> QueryBuilders.fieldQuery("field", "value") =\> field:"value"
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/How-to-converting-Lucene-Query-Parser-Syntax-to-ElasticSearch-Query-DSL-tp3749361p3765707.html](http://elasticsearch-users.115913.n3.nabble.com/How-to-converting-Lucene-Query-Parser-Syntax-to-ElasticSearch-Query-DSL-tp3749361p3765707.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com) ([http://Nabble.com](http://Nabble.com)).

---

<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/how-to-converting-lucene-query-parser-syntax-to-elasticsearch-query-dsl/6726/6 "2017-07-06T03:38:24Z")

</div>


