Closed vincentlauvlwj closed 6 years ago
@vincentlauvlwj That syntax looks very nice! Please send a PR.
For compatibility, I'd prefer not to remove the to
syntax completely, so can we make to
just call invoke
? Perhaps we can put a @Deprecated
annotation on to
methods that are no longer needed.
We'll need to keep the to
syntax for the cases where the right side is just a string, eg: Term
@mbuhot I just sent a PR, please check and merge it.
For example, when I'am constructing a range query, I write codes like this:
This 'to' method is declared in RangeBlock class like:
But I think it is better to use invoke operator overloading here, just replace the 'to' method with this:
Then we can write a query like this:
Now, we don't need to use the ugly key word anymore, the query looks clean.
Please consider this, or may I implement this myself and send a pull request to you?