You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jb...@apache.org on 2019/08/19 14:47:54 UTC

[lucene-solr] branch SOLR-13105-visual updated: SOLR-13105: Starting timeseries viz docs

This is an automated email from the ASF dual-hosted git repository.

jbernste pushed a commit to branch SOLR-13105-visual
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/SOLR-13105-visual by this push:
     new b3cb1d8  SOLR-13105: Starting timeseries viz docs
b3cb1d8 is described below

commit b3cb1d825ef0d412861d86568b281a4cb7e15713
Author: Joel Bernstein <jb...@apache.org>
AuthorDate: Mon Aug 19 10:47:13 2019 -0400

    SOLR-13105: Starting timeseries viz docs
---
 .../src/images/math-expressions/timeseries1.png    | Bin 0 -> 203182 bytes
 solr/solr-ref-guide/src/math-expressions.adoc      |   2 +-
 solr/solr-ref-guide/src/time-series.adoc           |  82 ++++++++++-----------
 3 files changed, 38 insertions(+), 46 deletions(-)

diff --git a/solr/solr-ref-guide/src/images/math-expressions/timeseries1.png b/solr/solr-ref-guide/src/images/math-expressions/timeseries1.png
new file mode 100644
index 0000000..feb596d
Binary files /dev/null and b/solr/solr-ref-guide/src/images/math-expressions/timeseries1.png differ
diff --git a/solr/solr-ref-guide/src/math-expressions.adoc b/solr/solr-ref-guide/src/math-expressions.adoc
index fab6921..243d7bd 100644
--- a/solr/solr-ref-guide/src/math-expressions.adoc
+++ b/solr/solr-ref-guide/src/math-expressions.adoc
@@ -59,7 +59,7 @@ image::images/math-expressions/curve-fitting.png[]
 
 *<<curve-fitting.adoc#curve-fitting,Curve Fitting>>*: Polynomial, Harmonic and Gaussian curve fitting.
 
-*<<time-series.adoc#time-series,Time Series>>*: Aggregation, smoothing, differencing and anomaly detection of time series.
+*<<time-series.adoc#time-series,Time Series>>*: Time series aggregation, smoothing, differencing, anomaly detection and forecasting.
 
 *<<machine-learning.adoc#machine-learning,Machine Learning>>*: Functions used in machine learning.
 
diff --git a/solr/solr-ref-guide/src/time-series.adoc b/solr/solr-ref-guide/src/time-series.adoc
index ff90a74..393046f 100644
--- a/solr/solr-ref-guide/src/time-series.adoc
+++ b/solr/solr-ref-guide/src/time-series.adoc
@@ -24,18 +24,20 @@ This section of the user guide provides an overview of time series *aggregation*
 The `timeseries` function performs fast, distributed time
 series aggregation leveraging Solr's builtin faceting and date math capabilities.
 
-The example below performs a monthly time series aggregation:
+The example below performs a monthly time series aggregation over a collection of
+daily stock price data.  In this example the average monthly closing price is calculated for the stock
+ticker *amzn* between a specific date range.
 
 [source,text]
 ----
-timeseries(collection1,
-           q=*:*,
-           field="recdate_dt",
-           start="2012-01-20T17:33:18Z",
-           end="2012-12-20T17:33:18Z",
+timeseries(stocks,
+           q=ticker_s:amzn,
+           field="date_dt",
+           start="2010-01-01T00:00:00Z",
+           end="2017-11-01T00:00:00Z",
            gap="+1MONTH",
            format="YYYY-MM",
-           count(*))
+           avg(close_d))
 ----
 
 When this expression is sent to the `/stream` handler it responds with:
@@ -46,58 +48,42 @@ When this expression is sent to the `/stream` handler it responds with:
   "result-set": {
     "docs": [
       {
-        "recdate_dt": "2012-01",
-        "count(*)": 8703
+        "date_dt": "2010-01",
+        "avg(close_d)": 127.42315789473685
       },
       {
-        "recdate_dt": "2012-02",
-        "count(*)": 8648
+        "date_dt": "2010-02",
+        "avg(close_d)": 118.02105263157895
       },
       {
-        "recdate_dt": "2012-03",
-        "count(*)": 8621
+        "date_dt": "2010-03",
+        "avg(close_d)": 130.89739130434782
       },
       {
-        "recdate_dt": "2012-04",
-        "count(*)": 8533
+        "date_dt": "2010-04",
+        "avg(close_d)": 141.07
       },
       {
-        "recdate_dt": "2012-05",
-        "count(*)": 8792
+        "date_dt": "2010-05",
+        "avg(close_d)": 127.606
       },
       {
-        "recdate_dt": "2012-06",
-        "count(*)": 8598
+        "date_dt": "2010-06",
+        "avg(close_d)": 121.66681818181816
       },
       {
-        "recdate_dt": "2012-07",
-        "count(*)": 8679
+        "date_dt": "2010-07",
+        "avg(close_d)": 117.5190476190476
       },
-      {
-        "recdate_dt": "2012-08",
-        "count(*)": 8469
-      },
-      {
-        "recdate_dt": "2012-09",
-        "count(*)": 8637
-      },
-      {
-        "recdate_dt": "2012-10",
-        "count(*)": 8536
-      },
-      {
-        "recdate_dt": "2012-11",
-        "count(*)": 8785
-      },
-      {
-        "EOF": true,
-        "RESPONSE_TIME": 16
-      }
-    ]
-  }
-}
+      ...
 ----
 
+Using Zeppelin-Solr this time series can be visualized using a line chart or other visualization.
+
+image::images/math-expressions/timeseries1.png[]
+
+
+
 == Vectorizing the Time Series
 
 Before a time series result can be operated on by math expressions
@@ -116,7 +102,7 @@ let(a=timeseries(collection1,
                  start="2012-01-20T17:33:18Z",
                  end="2012-12-20T17:33:18Z",
                  gap="+1MONTH",
-                 format="YYYY-MM",
+                 format="yyyy-MM",
                  count(*)),
     b=col(a, count(*)))
 ----
@@ -321,6 +307,7 @@ When this expression is sent to the `/stream` handler it responds with:
 }
 ----
 
+
 == Differencing
 
 Differencing is often used to remove the
@@ -429,3 +416,8 @@ Expression is sent to the `/stream` handler it responds with:
   }
 }
 ----
+
+== Anomaly Detection
+
+== Forecasting
+