Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parser for Elastic Search query strings

I wonder if there is a grammar available which will be able to parse the query strings that are sent to Elastic Search query_string API?

The reference is here: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax

I'd prefer EBNF. I use Python currently just in case.

like image 428
Stasik Avatar asked Aug 27 '26 09:08

Stasik


1 Answers

You can find the EBNF grammar of the Lucene query string query parser here: https://github.com/apache/lucene-solr/blob/master/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.jj

The relevant build steps are here: https://github.com/apache/lucene-solr/blob/1d85cd783863f75cea133fb9c452302214165a4d/lucene/queryparser/build.xml#L63-L79

like image 118
Val Avatar answered Aug 29 '26 00:08

Val



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!