# Elastic search query syntax vs lucene query syntax

**URL:** <https://discuss.elastic.co/t/elastic-search-query-syntax-vs-lucene-query-syntax/23163>\
**Category:** Elasticsearch\
**Created:** [April 9, 2015, 3:36am UTC](https://discuss.elastic.co/t/elastic-search-query-syntax-vs-lucene-query-syntax/23163 "2015-04-09T03:36:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvnagaraju](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvnagaraju](https://discuss.elastic.co/u/bvnagaraju)\
**Post date:** [April 9, 2015, 3:36am UTC](https://discuss.elastic.co/t/elastic-search-query-syntax-vs-lucene-query-syntax/23163/1 "2015-04-09T03:36:31Z")

</div>

Can some one clarify /confirm this .

End user uses lucene query syntax .'

For proximity searches lucene has ~ operator where elastic search expects  
provide DSL in span queries

Example : lucene query "United States"~ 30(which is the user query) will be  
converted to span query by the elastic search clients like NEST

Am I correct

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bcf38a7c-a17f-4fa6-9278-7344631682ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bcf38a7c-a17f-4fa6-9278-7344631682ab%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [April 9, 2015, 9:29pm UTC](https://discuss.elastic.co/t/elastic-search-query-syntax-vs-lucene-query-syntax/23163/2 "2015-04-09T21:29:14Z")

</div>

Are you looking for the query\_string query?

> **[Query string query | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)**

On Thu, Apr 9, 2015 at 5:36 AM, bvnrwork [budda08nitt@gmail.com](mailto:budda08nitt@gmail.com) wrote:

> Can some one clarify /confirm this .
> 
> End user uses lucene query syntax .'
> 
> For proximity searches lucene has ~ operator where Elasticsearch expects  
> provide DSL in span queries
> 
> Example : lucene query "United States"~ 30(which is the user query) will  
> be converted to span query by the Elasticsearch clients like NEST
> 
> Am I correct
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/bcf38a7c-a17f-4fa6-9278-7344631682ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bcf38a7c-a17f-4fa6-9278-7344631682ab%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/bcf38a7c-a17f-4fa6-9278-7344631682ab%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bcf38a7c-a17f-4fa6-9278-7344631682ab%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAhadGw\_ey3gQb1ojOdOObzdH-qAdsD-zef2cSE39ME6nA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAhadGw_ey3gQb1ojOdOObzdH-qAdsD-zef2cSE39ME6nA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:20am UTC](https://discuss.elastic.co/t/elastic-search-query-syntax-vs-lucene-query-syntax/23163/3 "2017-07-06T00:20:33Z")

</div>


