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/06/14 18:29:47 UTC

[lucene-solr] branch SOLR-13105-visual updated: SOLR-13105: Add variables visualizations

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 5fd9d35  SOLR-13105: Add variables visualizations
5fd9d35 is described below

commit 5fd9d35ee54b7617e72a64300fd474a1eec5d638
Author: Joel Bernstein <jb...@apache.org>
AuthorDate: Fri Jun 14 14:29:29 2019 -0400

    SOLR-13105: Add variables visualizations
---
 .../src/images/math-expressions/variables.png      | Bin 0 -> 115161 bytes
 .../src/images/math-expressions/variables1.png     | Bin 0 -> 132814 bytes
 solr/solr-ref-guide/src/math-expressions.adoc      |   6 +--
 solr/solr-ref-guide/src/variables.adoc             |  54 +++++++++++++++++++++
 4 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/solr/solr-ref-guide/src/images/math-expressions/variables.png b/solr/solr-ref-guide/src/images/math-expressions/variables.png
new file mode 100644
index 0000000..0e3b65c
Binary files /dev/null and b/solr/solr-ref-guide/src/images/math-expressions/variables.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/variables1.png b/solr/solr-ref-guide/src/images/math-expressions/variables1.png
new file mode 100644
index 0000000..154388b
Binary files /dev/null and b/solr/solr-ref-guide/src/images/math-expressions/variables1.png differ
diff --git a/solr/solr-ref-guide/src/math-expressions.adoc b/solr/solr-ref-guide/src/math-expressions.adoc
index 24646ea..2fbb95c 100644
--- a/solr/solr-ref-guide/src/math-expressions.adoc
+++ b/solr/solr-ref-guide/src/math-expressions.adoc
@@ -29,11 +29,11 @@ image::images/math-expressions/curve-fitting.png[]
 
 *<<math-start.adoc#getting-started,Getting Started>>*: Getting started with Streaming Expressions, Math Expressions and Visualization.
 
-*<<scalar-math.adoc#scalar-math,Scalar Math>>*: The functions that apply to scalar numbers.
+*<<scalar-math.adoc#scalar-math,Scalar Math>>*: The functions for applying math to numbers and visualizing results.
 
-*<<vector-math.adoc#vector-math,Vector Math>>*: Vector math expressions and vector manipulation.
+*<<vector-math.adoc#vector-math,Vector Math>>*: Vector create, math, manipulation and visualization.
 
-*<<variables.adoc#variables,Variables and Caching>>*: Assigning and caching variables.
+*<<variables.adoc#variables,Variables and Caching>>*: Assigning, visualizing and caching variables.
 
 *<<matrix-math.adoc#matrix-math,Matrix Math>>*: Matrix creation, manipulation, and matrix math.
 
diff --git a/solr/solr-ref-guide/src/variables.adoc b/solr/solr-ref-guide/src/variables.adoc
index 2c1f905..1701b3a 100644
--- a/solr/solr-ref-guide/src/variables.adoc
+++ b/solr/solr-ref-guide/src/variables.adoc
@@ -142,6 +142,60 @@ When this expression is sent to the `/stream` handler it responds with:
 }
 ----
 
+== Visualizing Variables
+
+The *let* expression can also include a *zplot* expression that can be used to visualize the
+variables.
+
+In the example below the variables *a* and *b* are set to arrays. The zplot function
+outputs the variables as *x* and *y* fields in the output.
+
+[source,text]
+----
+let(a=array(1, 2, 3),
+    b=array(10, 20, 30),
+    zplot(x=a, y=b))
+----
+
+When this expression is sent to the `/stream` handler it responds with:
+
+[source,json]
+----
+{
+  "result-set": {
+    "docs": [
+      {
+        "x": 1,
+        "y": 10
+      },
+      {
+        "x": 2,
+        "y": 20
+      },
+      {
+        "x": 3,
+        "y": 30
+      },
+      {
+        "EOF": true,
+        "RESPONSE_TIME": 0
+      }
+    ]
+  }
+}
+----
+
+Using this approach variables can by visualized using Zeppelin-Solr. In the example below
+the arrays are shown in table format.
+
+image::images/math-expressions/variables.png[]
+
+Once in table format we can plot the variables using one of the plotting or charting
+visualizations. The example below shows variables plotted on a line chart:
+
+image::images/math-expressions/variables1.png[]
+
+
 == Caching Variables
 
 Variables can be cached in-memory on the Solr node where the math expression