title: Complex Lucene queries in ElasticSearch
body: <p>We've been using Lucene for the last years and we are about to migrate to ElasticSearch. We have lot of Lucene queries (complex ones) that we want to reuse. I've seen in ElasticSearch the "query_string" API (<a href="https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-query-string-query.html#query-string-syntax" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-query-string-query.html#query-string-syntax</a>). It works pretty good for simple queries, but it doesn't when using functions like <em>spanNear</em> or <em>spanOr</em>. See below a part of a query:</p>
  
  <pre><code>spanNear([spanOr([ADDRESS:13, ADDRESS:13a, ADDRESS:13b, ADDRESS:13c, ADDRESS:13d, ADDRESS:13e, ADDRESS:13f, ADDRESS:13g, ADDRESS:13h, ADDRESS:13i, ADDRESS:13j, ADDRESS:13k, ADDRESS:13l, ADDRESS:13m, ADDRESS:13n, ADDRESS:13r, ADDRESS:13s, ADDRESS:13u, ADDRESS:13v, ADDRESS:13w, ADDRESS:13x, ADDRESS:13y, ADDRESS:13z]), [ADDRESS:carlton, ADDRESS:chalton, ADDRESS:charaton, ADDRESS:charleton, ADDRESS:charlon, ADDRESS:charlson, ADDRESS:charlston, ADDRESS:charlton, ADDRESS:charltons, ADDRESS:charlvon, ADDRESS:charston, ADDRESS:charton, ADDRESS:chorlton, ADDRESS:harlton, ADDRESS:sharlton]))
  </code></pre>
  
  <p>Do you know which is the best way of using these kind of queries without rewriting them into ES format? We use the Lucene Java libraries for generating the queries in case it helps. Thanks in advance.</p>