bripkens / lucene

Node.js lib to transform: lucene query → syntax tree → lucene query
MIT License
72 stars 33 forks source link

Date rounding is reported as an error #58

Closed gjactat closed 10 months ago

gjactat commented 10 months ago

Hello,

First of all, thanks for providing this great library (very handy in many cases) ! I have noticed that date rounding is reported as an error.

Consider the following valid Lucene query :

dateModified_date:[NOW/YEAR TO NOW]

The slash after "NOW" is reported as unexpected :

Line 1, column 23: Expected ".", "TO", "\\", [^ \t\r\n\x0C{}()"/\^~[\]], or whitespace but "/" found.

We get the very same result when using the PEG grammar defined in this repository with PEG.js online.

Thanks for your attention

bripkens commented 10 months ago

@gjactat: Do you know whether this capability is also part of core lucene? If so, feel free to open a PR with the fix!

gjactat commented 10 months ago

You're right. Chances are it's a purely Solr mechanism. I tend to think of Lucene as Solr from time to time. So, from a purely Lucene point of view, this syntax does not need to be supported.

Thanks for your quick reply !