Parse queries in Lucene and Elasticsearch syntaxes