Move optional predicate DSL parameters to the terminal contexts
Description
is followed up by
Activity
Show:

Yoann Rodière March 18, 2019 at 1:20 PM
I’ll take this ticket, since I’d really like it to be in the next release at the end of the week, and you already have important work to finish by then.
Fixed
Details
Details
Assignee

Reporter

Components
Sprint
None
Fix versions
Priority
Created February 22, 2019 at 9:34 AM
Updated March 21, 2019 at 5:27 PM
Resolved March 19, 2019 at 12:55 PM
For example, the current syntax looks like this:
After this change, it would look like this:
Pros:
More consistent: currently, some options are specified before the field path, some after. After this change, every option comes at the end. Note it's also more consistent with the projection/sort DSL, where options always come after we specify the field path.
Easier to read: the main information is specified first (type of predicate, fields, value to match), and the details come later
Clearer errors: some options (for example
fuzzy
) are supposed to throw an exception when applied to a field that doesn't support it (an integer field, for example). With the new syntax, we would be able to throw the exception when the option is set, because we know of all the targeted fields at that point. Currently we don't, so we throw the exception later, whenmatching
is called, which is slightly confusing.Cons:
Yet another syntax change. But we're hardly similar to Search 5 anymore, so one more syntax change is not the end of the world...