[SearchBar] Dates, Booleans, Numbers and Range Clauses #485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added date, boolean and number support to the Query language. With that, also added support for the following operations on field clauses:
>
)>=
)<
)<=
)When it comes to date values, we try to cover a large range of user friendly formats, including terms such as:
today
,yesterday
,last week
,next week
,this week
,this month
andlast/next month/year
.Date operation also respect the granularity of the date.. for example,
today
refers to the full day, therefore the value has aDAY
granularity. Therefore, the expressiondate:'today'
will match any value that falls in the full day (you can think about it as an implicit range)With this change, the search bar also supports a "schema" - this enables defining a more granular set of rules of how the query should be interpreted. For example, the schema may state that field
count
is of type 'number' - if the user tries to assign a string to this field, a parsing error will be triggered. Aside from the data types, the schema enables defining finer validation logic for the assigned field values.The
EuiInMemoryTable
was updated such that it is now possible to setschema: true
on its search box. This will deduce a schema from the configured columns. (this can further be enhanced in the future, by supportingsearchable
andvalidate
properties on the table columns).