jurismarches / luqum

A lucene query parser generating ElasticSearch queries and more !
Other
188 stars 40 forks source link

Support for date arithmetics in queries #26

Open shyam81295 opened 6 years ago

shyam81295 commented 6 years ago

It would be great if words like now, now-5h, now-1h can be used in dates, without being treated as simple string.

Parsing date : [now-1h TO now] would add more meaning to luqum. These human-readable queries are supported in Elasticsearch. See here Common options

P.S. When I checked, this feature was not implemented. Kindly reply, if it is already there.

alexgarel commented 6 years ago

Hello @shyam81295,

This is a good idea to support it. We should also consider supporting the original Lucene format (where "now" is "NOW").

Right now this won't be on our priority list, but you can contribute a PR, including tests.