Skip to content

Commit

Permalink
Improve time-series error and documentation (elastic#100018)
Browse files Browse the repository at this point in the history
* Improve time-series error and documentation

* spotless fix

* Update docs/changelog/100018.yaml

* Fix changelist

* Change exception type
  • Loading branch information
kkrik-es authored Sep 29, 2023
1 parent 9d01def commit c7705aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/100018.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 100018
summary: Improve time-series error and documentation
area: "TSDB"
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ PUT /my-time-series-index-0/_bulk
--------------------------------------------------
// NOTCONSOLE

//////////////////////////
To perform a time series aggregation, specify "time_series" as the aggregation type. When the boolean "keyed"
is true, each bucket is given a unique key.

Expand All @@ -85,8 +83,6 @@ GET /_search
--------------------------------------------------
// NOTCONSOLE

//////////////////////////

This will return all results in the time series, however a more typical query will use sub aggregations to reduce the
date returned to something more relevant.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public long getTimestamp() {
}

public int getTsidOrd() {
if (tsidOrdProvider == null) {
throw new IllegalArgumentException(
"Aggregation on a time-series field is misconfigured, likely due to lack of wrapping "
+ "a metric aggregation within a `time-series` aggregation"
);
}
return tsidOrdProvider.getAsInt();
}
}

0 comments on commit c7705aa

Please sign in to comment.