Lucene query parser to ES Java API

Is there a utility that can convert lucene query string format to ES Java
API format? We are planning to use lucene query parser to validate query
string entered by user in our application before creating a request to ES.

http://lucene.apache.org/core/2_9_4/queryparsersyntax.html

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Not sure if much has changed since I asked a similar question a while back:

https://groups.google.com/forum/#!msg/elasticsearch/f4hE3lHsJeA/u0ovOO91Vr4J

Jorg's suggestion at the very end if perhaps the best, although I have
continued using my own method.

https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

--
Ivan

On Tue, Mar 11, 2014 at 4:45 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

Is there a utility that can convert lucene query string format to ES Java
API format? We are planning to use lucene query parser to validate query
string entered by user in our application before creating a request to ES.

Apache Lucene - Query Parser Syntax

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

You may want to look at using the simple query string query instead:

It has the benefit of not throwing syntax errors, but trying to do the
right thing.

On 12 March 2014 01:53, Ivan Brusic ivan@brusic.com wrote:

Not sure if much has changed since I asked a similar question a while back:

Redirecting to Google Groups

Jorg's suggestion at the very end if perhaps the best, although I have
continued using my own method.

https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

--
Ivan

On Tue, Mar 11, 2014 at 4:45 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

Is there a utility that can convert lucene query string format to ES Java
API format? We are planning to use lucene query parser to validate query
string entered by user in our application before creating a request to ES.

Apache Lucene - Query Parser Syntax

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Yeah, don't try to wrap the query_string in piles of regexes to make sure
it never throws errors and blocks features you don't want but lets through
features you do. It isn't fun.

On Wed, Mar 12, 2014 at 6:36 AM, Clinton Gormley clint@traveljury.comwrote:

You may want to look at using the simple query string query instead:
Elasticsearch Platform — Find real-time answers at scale | Elastic

It has the benefit of not throwing syntax errors, but trying to do the
right thing.

On 12 March 2014 01:53, Ivan Brusic ivan@brusic.com wrote:

Not sure if much has changed since I asked a similar question a while
back:

Redirecting to Google Groups

Jorg's suggestion at the very end if perhaps the best, although I have
continued using my own method.

https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

--
Ivan

On Tue, Mar 11, 2014 at 4:45 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

Is there a utility that can convert lucene query string format to ES
Java API format? We are planning to use lucene query parser to validate
query string entered by user in our application before creating a request
to ES.

Apache Lucene - Query Parser Syntax

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2cwOW9usqk%2B7CWX5LLzheM7qB0NZrconyo12TMzgQNuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

So suggestion is to just use java api simple query string object which I
presume uses same syntax as lucene?

On Wed, Mar 12, 2014 at 10:25 AM, Nikolas Everett nik9000@gmail.com wrote:

Yeah, don't try to wrap the query_string in piles of regexes to make sure
it never throws errors and blocks features you don't want but lets through
features you do. It isn't fun.

On Wed, Mar 12, 2014 at 6:36 AM, Clinton Gormley clint@traveljury.comwrote:

You may want to look at using the simple query string query instead:
Elasticsearch Platform — Find real-time answers at scale | Elastic

It has the benefit of not throwing syntax errors, but trying to do the
right thing.

On 12 March 2014 01:53, Ivan Brusic ivan@brusic.com wrote:

Not sure if much has changed since I asked a similar question a while
back:

Redirecting to Google Groups

Jorg's suggestion at the very end if perhaps the best, although I have
continued using my own method.

https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

--
Ivan

On Tue, Mar 11, 2014 at 4:45 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

Is there a utility that can convert lucene query string format to ES
Java API format? We are planning to use lucene query parser to validate
query string entered by user in our application before creating a request
to ES.

Apache Lucene - Query Parser Syntax

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2cwOW9usqk%2B7CWX5LLzheM7qB0NZrconyo12TMzgQNuw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAPmjWd2cwOW9usqk%2B7CWX5LLzheM7qB0NZrconyo12TMzgQNuw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAOT3TWoyxqaQPSXakSzFxmVDxfsRx8zavj-MizqhcdhmXtg-kA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I am still trying to figure this out on how I can do this using ES java
API. For eg: if user types the below search in the query string using
lucene syntax to our app server can I use this with ES Java API?

http://mypage.com/search?title:"elasticsearch" AND author:"Mohit"

On Wed, Mar 12, 2014 at 1:05 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

So suggestion is to just use java api simple query string object which I
presume uses same syntax as lucene?

On Wed, Mar 12, 2014 at 10:25 AM, Nikolas Everett nik9000@gmail.comwrote:

Yeah, don't try to wrap the query_string in piles of regexes to make sure
it never throws errors and blocks features you don't want but lets through
features you do. It isn't fun.

On Wed, Mar 12, 2014 at 6:36 AM, Clinton Gormley clint@traveljury.comwrote:

You may want to look at using the simple query string query instead:
Elasticsearch Platform — Find real-time answers at scale | Elastic

It has the benefit of not throwing syntax errors, but trying to do the
right thing.

On 12 March 2014 01:53, Ivan Brusic ivan@brusic.com wrote:

Not sure if much has changed since I asked a similar question a while
back:

Redirecting to Google Groups

Jorg's suggestion at the very end if perhaps the best, although I have
continued using my own method.

https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

--
Ivan

On Tue, Mar 11, 2014 at 4:45 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

Is there a utility that can convert lucene query string format to ES
Java API format? We are planning to use lucene query parser to validate
query string entered by user in our application before creating a request
to ES.

Apache Lucene - Query Parser Syntax

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2cwOW9usqk%2B7CWX5LLzheM7qB0NZrconyo12TMzgQNuw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAPmjWd2cwOW9usqk%2B7CWX5LLzheM7qB0NZrconyo12TMzgQNuw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAOT3TWrVngeK2YJ0ANzfnr_h_y9RPiRt8%3DxRg3z2RHE-PwE4_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

It looks like I can use it this way:

QueryBuilders.queryString("title:"elasticsearch" AND author:"Mohit"");

On Wed, Mar 19, 2014 at 5:05 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

I am still trying to figure this out on how I can do this using ES java
API. For eg: if user types the below search in the query string using
lucene syntax to our app server can I use this with ES Java API?

http://mypage.com/search?title:"elasticsearch" AND author:"Mohit"

On Wed, Mar 12, 2014 at 1:05 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

So suggestion is to just use java api simple query string object which I
presume uses same syntax as lucene?

On Wed, Mar 12, 2014 at 10:25 AM, Nikolas Everett nik9000@gmail.comwrote:

Yeah, don't try to wrap the query_string in piles of regexes to make
sure it never throws errors and blocks features you don't want but lets
through features you do. It isn't fun.

On Wed, Mar 12, 2014 at 6:36 AM, Clinton Gormley clint@traveljury.comwrote:

You may want to look at using the simple query string query instead:
Elasticsearch Platform — Find real-time answers at scale | Elastic

It has the benefit of not throwing syntax errors, but trying to do the
right thing.

On 12 March 2014 01:53, Ivan Brusic ivan@brusic.com wrote:

Not sure if much has changed since I asked a similar question a while
back:

Redirecting to Google Groups

Jorg's suggestion at the very end if perhaps the best, although I have
continued using my own method.

https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

--
Ivan

On Tue, Mar 11, 2014 at 4:45 PM, Mohit Anchlia <mohitanchlia@gmail.com

wrote:

Is there a utility that can convert lucene query string format to ES
Java API format? We are planning to use lucene query parser to validate
query string entered by user in our application before creating a request
to ES.

Apache Lucene - Query Parser Syntax

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWr5FphvtUDyHLy0%2BUzPUPQTPwkdP2oiCPZ75UU_d4%3DWKg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCv5sbLQNb34nrHtgtONCEgf1JsywBcydAcibEu4ony0Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAPt3XKQaiTydX2VK6qjSop6Ho4U0q%2BOiqbLyTAQ8emJpuG%2BW4A%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2cwOW9usqk%2B7CWX5LLzheM7qB0NZrconyo12TMzgQNuw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAPmjWd2cwOW9usqk%2B7CWX5LLzheM7qB0NZrconyo12TMzgQNuw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAOT3TWoWJq-ZnYeJu1f5-ZKXXMMbEHdf5-R7n1V27-ZukVrTqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.