jurismarches / luqum

A lucene query parser generating ElasticSearch queries and more !
Other
187 stars 42 forks source link

Add support for unbounded ranges #91

Closed JSCU-CNI closed 1 year ago

JSCU-CNI commented 1 year ago

This pull request adds support for open ranges, i.e. inequality operators in front of a term. In tree form, the < is named To, and > is named From.

Additionally, this commit also adds a TreeTransformer to convert these open ranges to more traditional Range objects.

To properly support escaping, this commit also adjusts how escaping sequences work. After careful evaluation of how Apache Lucene handles escape sequences, it appears that random characters can be escaped, even if they result in unknown escape sequences: the escaped character is always yielded. This makes support for operations such as <\=foo a lot less complicated.

This PR does not add support in the ElasticsearchQueryBuilder.

JSCU-CNI commented 1 year ago

I have fixed most issues, though I have left open the discussion regarding the merge algorithm. Please let me know how you'd like to proceed regarding that issue.