Move optional predicate DSL parameters to the terminal contexts

Description

For example, the current syntax looks like this:

After this change, it would look like this:

Pros:

  1. 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.

  2. Easier to read: the main information is specified first (type of predicate, fields, value to match), and the details come later

  3. 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, when matching is called, which is slightly confusing.

Cons:

  1. 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...

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

Assignee

Reporter

Components

Sprint

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