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 2018/08/27 20:12:14 UTC

lucene-solr:branch_7x: SOLR-12702: Add math expression userguid documentation

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x e93f6db47 -> e50be7ee3


SOLR-12702: Add math expression userguid documentation


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e50be7ee
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e50be7ee
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e50be7ee

Branch: refs/heads/branch_7x
Commit: e50be7ee3c451c4f8748f113df1cf39312e44a7b
Parents: e93f6db
Author: Joel Bernstein <jb...@apache.org>
Authored: Mon Aug 27 16:10:15 2018 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Mon Aug 27 16:11:54 2018 -0400

----------------------------------------------------------------------
 solr/solr-ref-guide/src/statistics.adoc | 38 ++++++++++++++++++++++++++++
 solr/solr-ref-guide/src/variables.adoc  |  4 +--
 2 files changed, 40 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e50be7ee/solr/solr-ref-guide/src/statistics.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/statistics.adoc b/solr/solr-ref-guide/src/statistics.adoc
index 74da76b..7d3ea94 100644
--- a/solr/solr-ref-guide/src/statistics.adoc
+++ b/solr/solr-ref-guide/src/statistics.adoc
@@ -573,3 +573,41 @@ When this expression is sent to the /stream handler it responds with:
   }
 }
 ----
+
+== Z-scores
+
+The `zscores` function converts a numeric array to an array of z-scores. The z-score
+is the number of standard deviations a number is from the mean.
+
+The example below computes the z-scores for the values in an array.
+
+
+[source,text]
+----
+let(a=array(1,2,3),
+    b=zscores(a))
+----
+
+When this expression is sent to the /stream handler it responds with:
+
+[source,json]
+----
+{
+  "result-set": {
+    "docs": [
+      {
+        "b": [
+          -1,
+          0,
+          1
+        ]
+      },
+      {
+        "EOF": true,
+        "RESPONSE_TIME": 27
+      }
+    ]
+  }
+}
+----
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e50be7ee/solr/solr-ref-guide/src/variables.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/variables.adoc b/solr/solr-ref-guide/src/variables.adoc
index f1ac26c..99ac750 100644
--- a/solr/solr-ref-guide/src/variables.adoc
+++ b/solr/solr-ref-guide/src/variables.adoc
@@ -157,7 +157,7 @@ The `putCache` function adds a variable to the cache.
 
 In the example below an array is cached in the *workspace* workspace1
 and bound to the *key* key1. The workspace allows different users to cache
-objects in their own workspace. The`putCache` function returns
+objects in their own workspace. The `putCache` function returns
 the variable that was added to the cache.
 
 [source,text]
@@ -213,7 +213,7 @@ responds with:
   "result-set": {
     "docs": [
       {
-        "d": [
+        "a": [
           11,
           22,
           33