Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SearchBar] Dates, Booleans, Numbers and Range Clauses #485

Merged
merged 1 commit into from
Mar 30, 2018
Merged

[SearchBar] Dates, Booleans, Numbers and Range Clauses #485

merged 1 commit into from
Mar 30, 2018

Conversation

uboness
Copy link
Contributor

@uboness uboness commented Mar 8, 2018

Added date, boolean and number support to the Query language. With that, also added support for the following operations on field clauses:

  • greater than (>)
  • greater than or equals (>=)
  • less than (<)
  • less than or equals (<=)

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 and last/next month/year.

Date operation also respect the granularity of the date.. for example, today refers to the full day, therefore the value has a DAY granularity. Therefore, the expression date:'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 set schema: true on its search box. This will deduce a schema from the configured columns. (this can further be enhanced in the future, by supporting searchable and validate properties on the table columns).

Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'm excited for this!

Added date, boolean and number support to the Query language. With that, also added support for the following operations on field clauses:

- greater than (`gt`)
- greater than or equals (`gte`)
- less than (`lt`)
- less than or equals (`lte`)

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` and `last/next month/year`.

Date operation also respect the granularity of the date.. for example, `today` refers to the full day, therefore the value has a `DAY` granularity. Therefore, the expression `date:'today'` will match any value that falls in the full day.

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 set `schema: true` on its search box. This will deduce a schema from the configured columns. (this can further be enhanced in the future, by supporting `searchable` and `validate` properties on the table columns).
@uboness uboness merged commit 1309398 into elastic:master Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants