-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Update Range mapping type docs #62112
Conversation
Pinging @elastic/es-docs (>docs) |
Pinging @elastic/es-search (:Search/Mapping) |
1 similar comment
Pinging @elastic/es-search (:Search/Mapping) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a small nit and am not sure if "range" aggs are supported for this range
fields, at least I didn't get it to work when I tried, but maybe I'm missing something. My active knowledge is limited here.
@@ -4,6 +4,13 @@ | |||
<titleabbrev>Range</titleabbrev> | |||
++++ | |||
|
|||
A field that represents a relation between a lower and upper bound, using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: might be just me, but I feel like the field doesn't represent the "relation" between the bounds but a continuous range of values between those bounds. The relations are then used to define and query the range. Maybe my understanding is off here, not a native speaker, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I think a couple of high-level examples may make this a bit clearer:
Range field types represent a continuous range of values between an upper and
lower bound. For example, a range field can represent values like any integer
between 1 and 5 or any date in October.
relations `gt`, `gte`, `lt` and `lte`. They can be used for querying, and have | ||
limited support for aggregations. The only supported aggregations are | ||
{ref}/search-aggregations-bucket-histogram-aggregation.html[histogram], | ||
{ref}/search-aggregations-bucket-range-aggregation.html[range] and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried range
aggregation on simple integer_range
and date_range
fields on 7.7 and master, gettting errors for both that these fields are not supported for this type of field. Maybe I'm missing something, what did you check or refer to when adding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some feedback around the information hierarchy and some suggestions for improvement.
Let me know if you'd like any help implementing those. Thanks for the PR!
`date_range`:: A range of date values represented as unsigned 64-bit integer milliseconds elapsed since system epoch. | ||
Date ranges accept the same formats described in the <<date, `date`>> type, but `now` is not allowed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can elaborate a little more for clarity.
`date_range`:: A range of date values represented as unsigned 64-bit integer milliseconds elapsed since system epoch. | |
Date ranges accept the same formats described in the <<date, `date`>> type, but `now` is not allowed. | |
`date_range`:: | |
A range of <<date,`date`>> values. Date ranges support various date formats | |
through the <<mapping-date-format,`format`>> mapping parameter. Regardless of | |
the format used, date values are parsed into an unsigned 64-bit integer | |
representing milliseconds since the Unix epoch in UTC. Values containing the | |
`now` <<date-math,date math>> expression are not supported. |
relations `gt`, `gte`, `lt` and `lte`. They can be used for querying, and have | ||
limited support for aggregations. The only supported aggregations are | ||
{ref}/search-aggregations-bucket-histogram-aggregation.html[histogram], | ||
{ref}/search-aggregations-bucket-range-aggregation.html[range] and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move the operators and common uses after the range types. I think many users will want to know what range types are available before getting info on how to define or use them.
@@ -4,6 +4,13 @@ | |||
<titleabbrev>Range</titleabbrev> | |||
++++ | |||
|
|||
A field that represents a relation between a lower and upper bound, using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I think a couple of high-level examples may make this a bit clearer:
Range field types represent a continuous range of values between an upper and
lower bound. For example, a range field can represent values like any integer
between 1 and 5 or any date in October.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM. Thanks for the iteration @wylieconlon.
I'll merge and backport when @cbuescher approves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, LGTM
Co-authored-by: Wylie Conlon <[email protected]>
Co-authored-by: Wylie Conlon <[email protected]>
The documentation for this mapping type was missing some important information about how to define and use ranges.