You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ct...@apache.org on 2017/09/26 02:25:38 UTC

[2/4] lucene-solr:branch_7x: Ref Guide: rename Streaming docs to fix broken intra-doc links in the PDF due to mismatching anchor names

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8330ba1d/solr/solr-ref-guide/src/stream-decorators.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/stream-decorators.adoc b/solr/solr-ref-guide/src/stream-decorators.adoc
deleted file mode 100644
index 2afb524..0000000
--- a/solr/solr-ref-guide/src/stream-decorators.adoc
+++ /dev/null
@@ -1,1216 +0,0 @@
-= Stream Decorator Reference
-:page-shortname: stream-decorators
-:page-permalink: stream-decorators.html
-:page-tocclass: right
-:page-toclevels: 1
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-== cartesianProduct
-
-The `cartesianProduct` function turns a single tuple with a multi-valued field (ie. an array) into multiple tuples, one for each value in the array field. That is, given a single tuple containing an array of N values for fieldA, the `cartesianProduct` function will output N tuples, each with one value from the original tuple's array. In essence, you can flatten arrays for further processing.
-
-For example, using `cartesianProduct` you can turn this tuple
-[source,text]
-----
-{
-  "fieldA": "foo",
-  "fieldB": ["bar","baz","bat"]
-}
-----
-
-into the following 3 tuples
-[source,text]
-----
-{
-  "fieldA": "foo",
-  "fieldB": "bar"
-}
-{
-  "fieldA": "foo",
-  "fieldB": "baz"
-}
-{
-  "fieldA": "foo",
-  "fieldB": "bat"
-}
-----
-
-=== cartesianProduct Parameters
-
-* `incoming stream`: (Mandatory) A single incoming stream.
-* `fieldName or evaluator`: (Mandatory) Name of field to flatten values for, or evaluator whose result should be flattened.
-* `productSort='fieldName ASC|DESC'`: (Optional) Sort order of the newly generated tuples.
-
-=== cartesianProduct Syntax
-
-[source,text]
-----
-cartesianProduct(
-  <stream>,
-  <fieldName | evaluator> [as newFieldName],
-  productSort='fieldName ASC|DESC'
-)
-----
-
-=== cartesianProduct Examples
-
-The following examples show different outputs for this source tuple
-
-[source,text]
-----
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3]
-}
-----
-
-==== Single Field, No Sorting
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  fieldB
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": [1,2,3]
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": [1,2,3]
-}
-----
-
-==== Single Evaluator, No Sorting
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  sequence(3,4,5) as fieldE
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3],
-  "fieldE": 4
-}
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3],
-  "fieldE": 9
-}
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3],
-  "fieldE": 14
-}
-----
-
-==== Single Field, Sorted by Value
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  fieldB,
-  productSort="fieldB DESC"
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": [1,2,3]
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": [1,2,3]
-}
-----
-
-==== Single Evaluator, Sorted by Evaluator Values
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  sequence(3,4,5) as fieldE,
-  productSort='newFieldE DESC'
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3],
-  "fieldE": 14
-}
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3],
-  "fieldE": 9
-}
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3],
-  "fieldE": 4
-}
-----
-
-==== Renamed Single Field, Sorted by Value
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  fieldB as newFieldB,
-  productSort="fieldB DESC"
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3]
-  "newFieldB": "valueB2",
-}
-{
-  "fieldA": "valueA",
-  "fieldB": ["valueB1","valueB2"],
-  "fieldC": [1,2,3]
-  "newFieldB": "valueB1",
-}
-----
-
-==== Multiple Fields, No Sorting
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  fieldB,
-  fieldC
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 1
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 2
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 3
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 1
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 2
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 3
-}
-----
-
-==== Multiple Fields, Sorted by Single Field
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  fieldB,
-  fieldC,
-  productSort="fieldC ASC"
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 1
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 1
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 2
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 2
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 3
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 3
-}
-----
-
-==== Multiple Fields, Sorted by Multiple Fields
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  fieldB,
-  fieldC,
-  productSort="fieldC ASC, fieldB DESC"
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 1
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 1
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 2
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 2
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB2",
-  "fieldC": 3
-}
-{
-  "fieldA": "valueA",
-  "fieldB": "valueB1",
-  "fieldC": 3
-}
-----
-
-==== Field and Evaluator, No Sorting
-
-[source,text]
-----
-cartesianProduct(
-  search(collection1, q='*:*', fl='fieldA, fieldB, fieldC', sort='fieldA ASC'),
-  sequence(3,4,5) as fieldE,
-  fieldB
-)
-
-{
-  "fieldA": "valueA",
-  "fieldB": valueB1,
-  "fieldC": [1,2,3],
-  "fieldE": 4
-}
-{
-  "fieldA": "valueA",
-  "fieldB": valueB2,
-  "fieldC": [1,2,3],
-  "fieldE": 4
-}
-{
-  "fieldA": "valueA",
-  "fieldB": valueB1,
-  "fieldC": [1,2,3],
-  "fieldE": 9
-}
-{
-  "fieldA": "valueA",
-  "fieldB": valueB2,
-  "fieldC": [1,2,3],
-  "fieldE": 9
-}
-{
-  "fieldA": "valueA",
-  "fieldB": valueB1,
-  "fieldC": [1,2,3],
-  "fieldE": 14
-}
-{
-  "fieldA": "valueA",
-  "fieldB": valueB2,
-  "fieldC": [1,2,3],
-  "fieldE": 14
-}
-----
-
-As you can see in the examples above, the `cartesianProduct` function does support flattening tuples across multiple fields and/or evaluators.
-
-== classify
-
-The `classify` function classifies tuples using a logistic regression text classification model. It was designed specifically to work with models trained using the <<stream-sources.adoc#train,train function>>. The `classify` function uses the <<stream-sources.adoc#model,model function>> to retrieve a stored model and then scores a stream of tuples using the model. The tuples read by the classifier must contain a text field that can be used for classification. The classify function uses a Lucene analyzer to extract the features from the text so the model can be applied. By default the `classify` function looks for the analyzer using the name of text field in the tuple. If the Solr schema on the worker node does not contain this field, the analyzer can be looked up in another field by specifying the `analyzerField` parameter.
-
-Each tuple that is classified is assigned two scores:
-
-* probability_d* : A float between 0 and 1 which describes the probability that the tuple belongs to the class. This is useful in the classification use case.
-
-* score_d* : The score of the document that has not be squashed between 0 and 1. The score may be positive or negative. The higher the score the better the document fits the class. This un-squashed score will be useful in query re-ranking and recommendation use cases. This score is particularly useful when multiple high ranking documents have a probability_d score of 1, which won't provide a meaningful ranking between documents.
-
-=== classify Parameters
-
-* `model expression`: (Mandatory) Retrieves the stored logistic regression model.
-* `field`: (Mandatory) The field in the tuples to apply the classifier to. By default the analyzer for this field in the schema will be used extract the features.
-* `analyzerField`: (Optional) Specifies a different field to find the analyzer from in the schema.
-
-=== classify Syntax
-
-[source,text]
-----
-classify(model(modelCollection,
-             id="model1",
-             cacheMillis=5000),
-         search(contentCollection,
-             q="id:(a b c)",
-             fl="text_t, id",
-             sort="id asc"),
-             field="text_t")
-----
-
-In the example above the `classify expression` is retrieving the model using the `model` function. It is then classifying tuples returned by the `search` function. The `text_t` field is used for the text classification and the analyzer for the `text_t` field in the Solr schema is used to analyze the text and extract the features.
-
-== commit
-
-The `commit` function wraps a single stream (A) and given a collection and batch size will send commit messages to the collection when the batch size is fulfilled or the end of stream is reached. A commit stream is used most frequently with an update stream and as such the commit will take into account possible summary tuples coming from the update stream. All tuples coming into the commit stream will be returned out of the commit stream - no tuples will be dropped and no tuples will be added.
-
-=== commit Parameters
-
-* `collection`: The collection to send commit messages to (required)
-* `batchSize`: The commit batch size, sends commit message when batch size is hit. If not provided (or provided as value 0) then a commit is only sent at the end of the incoming stream.
-* `waitFlush`: The value passed directly to the commit handler (true/false, default: false)
-* `waitSearcher`: The value passed directly to the commit handler (true/false, default: false)
-* `softCommit`: The value passed directly to the commit handler (true/false, default: false)
-* `StreamExpression for StreamA` (required)
-
-=== commit Syntax
-
-[source,text]
-----
-commit(
-    destinationCollection,
-    batchSize=2,
-    update(
-        destinationCollection,
-        batchSize=5,
-        search(collection1, q=*:*, fl="id,a_s,a_i,a_f,s_multi,i_multi", sort="a_f asc, a_i asc")
-    )
-)
-----
-
-== complement
-
-The `complement` function wraps two streams (A and B) and emits tuples from A which do not exist in B. The tuples are emitted in the order in which they appear in stream A. Both streams must be sorted by the fields being used to determine equality (using the `on` parameter).
-
-=== complement Parameters
-
-* `StreamExpression for StreamA`
-* `StreamExpression for StreamB`
-* `on`: Fields to be used for checking equality of tuples between A and B. Can be of the format `on="fieldName"`, `on="fieldNameInLeft=fieldNameInRight"`, or `on="fieldName, otherFieldName=rightOtherFieldName"`.
-
-=== complement Syntax
-
-[source,text]
-----
-complement(
-  search(collection1, q=a_s:(setA || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s asc"),
-  search(collection1, q=a_s:(setB || setAB), fl="id,a_s,a_i", sort="a_i asc"),
-  on="a_i"
-)
-
-complement(
-  search(collection1, q=a_s:(setA || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s asc"),
-  search(collection1, q=a_s:(setB || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s asc"),
-  on="a_i,a_s"
-)
-----
-
-== daemon
-
-The `daemon` function wraps another function and runs it at intervals using an internal thread. The `daemon` function can be used to provide both continuous push and pull streaming.
-
-=== Continuous Push Streaming
-
-With continuous push streaming the `daemon` function wraps another function and is then sent to the `/stream` handler for execution. The `/stream` handler recognizes the `daemon` function and keeps it resident in memory, so it can run its internal function at intervals.
-
-In order to facilitate the pushing of tuples, the `daemon` function must wrap another stream decorator that pushes the tuples somewhere. One example of this is the `update` function, which wraps a stream and sends the tuples to another SolrCloud collection for indexing.
-
-=== daemon Syntax
-
-[source,text]
-----
-daemon(id="uniqueId",
-       runInterval="1000",
-       terminate="true",
-       update(destinationCollection,
-              batchSize=100,
-              topic(checkpointCollection,
-                    topicCollection,
-                    q="topic query",
-                    fl="id, title, abstract, text",
-                    id="topicId",
-                    initialCheckpoint=0)
-               )
-        )
-----
-
-The sample code above shows a `daemon` function wrapping an `update` function, which is wrapping a `topic` function. When this expression is sent to the `/stream` handler, the `/stream` hander sees the `daemon` function and keeps it in memory where it will run at intervals. In this particular example, the `daemon` function will run the `update` function every second. The `update` function is wrapping a <<stream-sources.adoc#topic,`topic` function>>, which will stream tuples that match the `topic` function query in batches. Each subsequent call to the topic will return the next batch of tuples for the topic. The `update` function will send all the tuples matching the topic to another collection to be indexed. The `terminate` parameter tells the daemon to terminate when the `topic` function stops sending tuples.
-
-The effect of this is to push documents that match a specific query into another collection. Custom push functions can be plugged in that push documents out of Solr and into other systems, such as Kafka or an email system.
-
-Push streaming can also be used for continuous background aggregation scenarios where aggregates are rolled up in the background at intervals and pushed to other Solr collections. Another use case is continuous background machine learning model optimization, where the optimized model is pushed to another Solr collection where it can be integrated into queries.
-
-The `/stream` handler supports a small set commands for listing and controlling daemon functions:
-
-[source,text]
-----
-http://localhost:8983/collection/stream?action=list
-----
-
-This command will provide a listing of the current daemon's running on the specific node along with there current state.
-
-[source,text]
-----
-http://localhost:8983/collection/stream?action=stop&id=daemonId
-----
-
-This command will stop a specific daemon function but leave it resident in memory.
-
-[source,text]
-----
-http://localhost:8983/collection/stream?action=start&id=daemonId
-----
-
-This command will start a specific daemon function that has been stopped.
-
-[source,text]
-----
-http://localhost:8983/collection/stream?action=kill&id=daemonId
-----
-
-This command will stop a specific daemon function and remove it from memory.
-
-=== Continuous Pull Streaming
-
-The {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/io/stream/DaemonStream.html[DaemonStream] java class (part of the SolrJ libraries) can also be embedded in a java application to provide continuous pull streaming. Sample code:
-
-[source,java]
-----
-StreamContext context = new StreamContext()
-SolrClientCache cache = new SolrClientCache();
-context.setSolrClientCache(cache);
-
-Map topicQueryParams = new HashMap();
-topicQueryParams.put("q","hello");  // The query for the topic
-topicQueryparams.put("rows", "500"); // How many rows to fetch during each run
-topicQueryparams.put("fl", "id", "title"); // The field list to return with the documents
-
-TopicStream topicStream = new TopicStream(zkHost,        // Host address for the zookeeper service housing the collections
-                                         "checkpoints",  // The collection to store the topic checkpoints
-                                         "topicData",    // The collection to query for the topic records
-                                         "topicId",      // The id of the topic
-                                         -1,             // checkpoint every X tuples, if set -1 it will checkpoint after each run.
-                                          topicQueryParams); // The query parameters for the TopicStream
-
-DaemonStream daemonStream = new DaemonStream(topicStream,             // The underlying stream to run.
-                                             "daemonId",              // The id of the daemon
-                                             1000,                    // The interval at which to run the internal stream
-                                             500);                    // The internal queue size for the daemon stream. Tuples will be placed in the queue
-                                                                      // as they are read by the internal internal thread.
-                                                                      // Calling read() on the daemon stream reads records from the internal queue.
-
-daemonStream.setStreamContext(context);
-
-daemonStream.open();
-
-//Read until it's time to shutdown the DaemonStream. You can define the shutdown criteria.
-while(!shutdown()) {
-    Tuple tuple = daemonStream.read() // This will block until tuples become available from the underlying stream (TopicStream)
-                                      // The EOF tuple (signaling the end of the stream) will never occur until the DaemonStream has been shutdown.
-    //Do something with the tuples
-}
-
-// Shutdown the DaemonStream.
-daemonStream.shutdown();
-
-//Read the DaemonStream until the EOF Tuple is found.
-//This allows the underlying stream to perform an orderly shutdown.
-
-while(true) {
-    Tuple tuple = daemonStream.read();
-    if(tuple.EOF) {
-        break;
-    } else {
-        //Do something with the tuples.
-    }
-}
-//Finally close the stream
-daemonStream.close();
-----
-
-== eval
-
-The `eval` function allows for use cases where new streaming expressions are generated on the fly and then evaluated.
-The `eval` function wraps a streaming expression and reads a single tuple from the underlying stream.
-The `eval` function then retrieves a string Streaming Expressions from the `expr_s` field of the tuple.
-The `eval` function then compiles the string Streaming Expression and emits the tuples.
-
-=== eval Parameters
-
-* `StreamExpression`: (Mandatory) The stream which provides the streaming expression to be evaluated.
-
-=== eval Syntax
-
-[source,text]
-----
-eval(expr)
-----
-
-In the example above the `eval` expression reads the first tuple from the underlying expression. It then compiles and
-executes the string Streaming Expression in the epxr_s field.
-
-== executor
-
-The `executor` function wraps a stream source that contains streaming expressions, and executes the expressions in parallel. The `executor` function looks for the expression in the `expr_s` field in each tuple. The `executor` function has an internal thread pool that runs tasks that compile and run expressions in parallel on the same worker node. This function can also be parallelized across worker nodes by wrapping it in the <<parallel,`parallel`>> function to provide parallel execution of expressions across a cluster.
-
-The `executor` function does not do anything specific with the output of the expressions that it runs. Therefore the expressions that are executed must contain the logic for pushing tuples to their destination. The <<update,update function>> can be included in the expression being executed to send the tuples to a SolrCloud collection for storage.
-
-This model allows for asynchronous execution of jobs where the output is stored in a SolrCloud collection where it can be accessed as the job progresses.
-
-=== executor Parameters
-
-* `threads`: (Optional) The number of threads in the executors thread pool for executing expressions.
-* `StreamExpression`: (Mandatory) The stream source which contains the Streaming Expressions to execute.
-
-=== executor Syntax
-
-[source,text]
-----
-daemon(id="myDaemon",
-       terminate="true",
-       executor(threads=10,
-                topic(checkpointCollection
-                      storedExpressions,
-                      q="*:*",
-                      fl="id, expr_s",
-                      initialCheckPoint=0,
-                      id="myTopic")))
-----
-
-In the example above a <<daemon,daemon>> wraps an executor, which wraps a <<stream-sources.adoc#topic,topic>> that is returning tuples with expressions to execute. When sent to the stream handler, the daemon will call the executor at intervals which will cause the executor to read from the topic and execute the expressions found in the `expr_s` field. The daemon will repeatedly call the executor until all the tuples that match the topic have been iterated, then it will terminate. This is the approach for executing batches of streaming expressions from a `topic` queue.
-
-== fetch
-
-The `fetch` function iterates a stream and fetches additional fields and adds them to the tuples. The `fetch` function fetches in batches to limit the number of calls back to Solr. Tuples streamed from the `fetch` function will contain the original fields and the additional fields that were fetched. The `fetch` function supports one-to-one fetches. Many-to-one fetches, where the stream source contains duplicate keys, will also work, but one-to-many fetches are currently not supported by this function.
-
-=== fetch Parameters
-
-* `Collection`: (Mandatory) The collection to fetch the fields from.
-* `StreamExpression`: (Mandatory) The stream source for the fetch function.
-* `fl`: (Mandatory) The fields to be fetched.
-* `on`: Fields to be used for checking equality of tuples between stream source and fetched records. Formatted as `on="fieldNameInTuple=fieldNameInCollection"`.
-* `batchSize`: (Optional) The batch fetch size.
-
-=== fetch Syntax
-
-[source,text]
-----
-fetch(addresses,
-      search(people, q="*:*", fl="username, firstName, lastName", sort="username asc"),
-      fl="streetAddress, city, state, country, zip",
-      on="username=userId")
-----
-
-The example above fetches addresses for users by matching the username in the tuple with the userId field in the addresses collection.
-
-== having
-
-The `having` expression wraps a stream and applies a boolean operation to each tuple. It emits only tuples for which the boolean operation returns *true*.
-
-=== having Parameters
-
-* `StreamExpression`: (Mandatory) The stream source for the having function.
-* `booleanEvaluator`: (Madatory) The following boolean operations are supported: `eq` (equals), `gt` (greater than), `lt` (less than), `gteq` (greater than or equal to), `lteq` (less than or equal to), `and`, `or`, `eor` (exclusive or), and `not`. Boolean evaluators can be nested with other evaluators to form complex boolean logic.
-
-The comparison evaluators compare the value in a specific field with a value, whether a string, number, or boolean. For example: `eq(field1, 10)`, returns `true` if `field1` is equal to 10.
-
-=== having Syntax
-
-[source,text]
-----
-having(rollup(over=a_s,
-              sum(a_i),
-              search(collection1,
-                     q=*:*,
-                     fl="id,a_s,a_i,a_f",
-                     sort="a_s asc")),
-       and(gt(sum(a_i), 100), lt(sum(a_i), 110)))
-
-----
-
-In this example, the `having` expression iterates the aggregated tuples from the `rollup` expression and emits all tuples where the field `sum(a_i)` is greater then 100 and less then 110.
-
-== leftOuterJoin
-
-The `leftOuterJoin` function wraps two streams, Left and Right, and emits tuples from Left. If there is a tuple in Right equal (as defined by `on`) then the values in that tuple will be included in the emitted tuple. An equal tuple in Right *need not* exist for the Left tuple to be emitted. This supports one-to-one, one-to-many, many-to-one, and many-to-many left outer join scenarios. The tuples are emitted in the order in which they appear in the Left stream. Both streams must be sorted by the fields being used to determine equality (using the `on` parameter). If both tuples contain a field of the same name then the value from the Right stream will be used in the emitted tuple.
-
-You can wrap the incoming streams with a `select` function to be specific about which field values are included in the emitted tuple.
-
-=== leftOuterJoin Parameters
-
-* `StreamExpression for StreamLeft`
-* `StreamExpression for StreamRight`
-* `on`: Fields to be used for checking equality of tuples between Left and Right. Can be of the format `on="fieldName"`, `on="fieldNameInLeft=fieldNameInRight"`, or `on="fieldName, otherFieldName=rightOtherFieldName"`.
-
-=== leftOuterJoin Syntax
-
-[source,text]
-----
-leftOuterJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  search(pets, q=type:cat, fl="personId,petName", sort="personId asc"),
-  on="personId"
-)
-
-leftOuterJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  search(pets, q=type:cat, fl="ownerId,petName", sort="ownerId asc"),
-  on="personId=ownerId"
-)
-
-leftOuterJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  select(
-    search(pets, q=type:cat, fl="ownerId,name", sort="ownerId asc"),
-    ownerId,
-    name as petName
-  ),
-  on="personId=ownerId"
-)
-----
-
-== hashJoin
-
-The `hashJoin` function wraps two streams, Left and Right, and for every tuple in Left which exists in Right will emit a tuple containing the fields of both tuples. This supports one-to-one, one-to-many, many-to-one, and many-to-many inner join scenarios. The tuples are emitted in the order in which they appear in the Left stream. The order of the streams does not matter. If both tuples contain a field of the same name then the value from the Right stream will be used in the emitted tuple.
-
-You can wrap the incoming streams with a `select` function to be specific about which field values are included in the emitted tuple.
-
-The hashJoin function can be used when the tuples of Left and Right cannot be put in the same order. Because the tuples are out of order this stream functions by reading all values from the Right stream during the open operation and will store all tuples in memory. The result of this is a memory footprint equal to the size of the Right stream.
-
-=== hashJoin Parameters
-
-* `StreamExpression for StreamLeft`
-* `hashed=StreamExpression for StreamRight`
-* `on`: Fields to be used for checking equality of tuples between Left and Right. Can be of the format `on="fieldName"`, `on="fieldNameInLeft=fieldNameInRight"`, or `on="fieldName, otherFieldName=rightOtherFieldName"`.
-
-=== hashJoin Syntax
-
-[source,text]
-----
-hashJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  hashed=search(pets, q=type:cat, fl="personId,petName", sort="personId asc"),
-  on="personId"
-)
-
-hashJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  hashed=search(pets, q=type:cat, fl="ownerId,petName", sort="ownerId asc"),
-  on="personId=ownerId"
-)
-
-hashJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  hashed=select(
-    search(pets, q=type:cat, fl="ownerId,name", sort="ownerId asc"),
-    ownerId,
-    name as petName
-  ),
-  on="personId=ownerId"
-)
-----
-
-== innerJoin
-
-Wraps two streams, Left and Right. For every tuple in Left which exists in Right a tuple containing the fields of both tuples will be emitted. This supports one-to-one, one-to-many, many-to-one, and many-to-many inner join scenarios. The tuples are emitted in the order in which they appear in the Left stream. Both streams must be sorted by the fields being used to determine equality (the 'on' parameter). If both tuples contain a field of the same name then the value from the Right stream will be used in the emitted tuple. You can wrap the incoming streams with a `select(...)` expression to be specific about which field values are included in the emitted tuple.
-
-=== innerJoin Parameters
-
-* `StreamExpression for StreamLeft`
-* `StreamExpression for StreamRight`
-* `on`: Fields to be used for checking equality of tuples between Left and Right. Can be of the format `on="fieldName"`, `on="fieldNameInLeft=fieldNameInRight"`, or `on="fieldName, otherFieldName=rightOtherFieldName"`.
-
-=== innerJoin Syntax
-
-[source,text]
-----
-innerJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  search(pets, q=type:cat, fl="personId,petName", sort="personId asc"),
-  on="personId"
-)
-
-innerJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  search(pets, q=type:cat, fl="ownerId,petName", sort="ownerId asc"),
-  on="personId=ownerId"
-)
-
-innerJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  select(
-    search(pets, q=type:cat, fl="ownerId,name", sort="ownerId asc"),
-    ownerId,
-    name as petName
-  ),
-  on="personId=ownerId"
-)
-----
-
-== intersect
-
-The `intersect` function wraps two streams, A and B, and emits tuples from A which *DO* exist in B. The tuples are emitted in the order in which they appear in stream A. Both streams must be sorted by the fields being used to determine equality (the `on` parameter). Only tuples from A are emitted.
-
-=== intersect Parameters
-
-* `StreamExpression for StreamA`
-* `StreamExpression for StreamB`
-* `on`: Fields to be used for checking equality of tuples between A and B. Can be of the format `on="fieldName"`, `on="fieldNameInLeft=fieldNameInRight"`, or `on="fieldName, otherFieldName=rightOtherFieldName"`.
-
-=== intersect Syntax
-
-[source,text]
-----
-intersect(
-  search(collection1, q=a_s:(setA || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s asc"),
-  search(collection1, q=a_s:(setB || setAB), fl="id,a_s,a_i", sort="a_i asc"),
-  on="a_i"
-)
-
-intersect(
-  search(collection1, q=a_s:(setA || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s asc"),
-  search(collection1, q=a_s:(setB || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s asc"),
-  on="a_i,a_s"
-)
-----
-
-== merge
-
-The `merge` function merges two or more streaming expressions and maintains the ordering of the underlying streams. Because the order is maintained, the sorts of the underlying streams must line up with the on parameter provided to the merge function.
-
-=== merge Parameters
-
-* `StreamExpression A`
-* `StreamExpression B`
-* `Optional StreamExpression C,D,....Z`
-* `on`: Sort criteria for performing the merge. Of the form `fieldName order` where order is `asc` or `desc`. Multiple fields can be provided in the form `fieldA order, fieldB order`.
-
-=== merge Syntax
-
-[source,text]
-----
-# Merging two stream expressions together
-merge(
-      search(collection1,
-             q="id:(0 3 4)",
-             fl="id,a_s,a_i,a_f",
-             sort="a_f asc"),
-      search(collection1,
-             q="id:(1)",
-             fl="id,a_s,a_i,a_f",
-             sort="a_f asc"),
-      on="a_f asc")
-----
-
-[source,text]
-----
-# Merging four stream expressions together. Notice that while the sorts of each stream are not identical they are
-# comparable. That is to say the first N fields in each stream's sort matches the N fields in the merge's on clause.
-merge(
-      search(collection1,
-             q="id:(0 3 4)",
-             fl="id,fieldA,fieldB,fieldC",
-             sort="fieldA asc, fieldB desc"),
-      search(collection1,
-             q="id:(1)",
-             fl="id,fieldA",
-             sort="fieldA asc"),
-      search(collection2,
-             q="id:(10 11 13)",
-             fl="id,fieldA,fieldC",
-             sort="fieldA asc"),
-      search(collection3,
-             q="id:(987)",
-             fl="id,fieldA,fieldC",
-             sort="fieldA asc"),
-      on="fieldA asc")
-----
-
-== null
-
-The null expression is a useful utility function for understanding bottlenecks when performing parallel relational algebra (joins, intersections, rollups etc.). The null function reads all the tuples from an underlying stream and returns a single tuple with the count and processing time. Because the null stream adds minimal overhead of it's own, it can be used to isolate the performance of Solr's /export handler. If the /export handlers performance is not the bottleneck, then the bottleneck is likely occurring in the workers where the stream decorators are running.
-
-The null expression can be wrapped by the parallel function and sent to worker nodes. In this scenario each worker will return one tuple with the count of tuples processed on the worker and the timing information for that worker. This gives valuable information such as:
-
-1.  As more workers are added does the performance of the /export handler improve or not.
-2.  Are tuples being evenly distributed across the workers, or is the hash partitioning sending more documents to a single worker.
-3.  Are all workers processing data at the same speed, or is one of the workers the source of the bottleneck.
-
-=== null Parameters
-
-* `StreamExpression`: (Mandatory) The expression read by the null function.
-
-=== null Syntax
-
-[source,text]
-----
- parallel(workerCollection,
-          null(search(collection1, q=*:*, fl="id,a_s,a_i,a_f", sort="a_s desc", qt="/export", partitionKeys="a_s")),
-          workers="20",
-          zkHost="localhost:9983",
-          sort="a_s desc")
-----
-
-The expression above shows a parallel function wrapping a null function. This will cause the null function to be run in parallel across 20 worker nodes. Each worker will return a single tuple with number of tuples processed and time it took to iterate the tuples.
-
-== outerHashJoin
-
-The `outerHashJoin` function wraps two streams, Left and Right, and emits tuples from Left. If there is a tuple in Right equal (as defined by the `on` parameter) then the values in that tuple will be included in the emitted tuple. An equal tuple in Right *need not* exist for the Left tuple to be emitted. This supports one-to-one, one-to-many, many-to-one, and many-to-many left outer join scenarios. The tuples are emitted in the order in which they appear in the Left stream. The order of the streams does not matter. If both tuples contain a field of the same name then the value from the Right stream will be used in the emitted tuple.
-
-You can wrap the incoming streams with a `select` function to be specific about which field values are included in the emitted tuple.
-
-The outerHashJoin stream can be used when the tuples of Left and Right cannot be put in the same order. Because the tuples are out of order, this stream functions by reading all values from the Right stream during the open operation and will store all tuples in memory. The result of this is a memory footprint equal to the size of the Right stream.
-
-=== outerHashJoin Parameters
-
-* `StreamExpression for StreamLeft`
-* `hashed=StreamExpression for StreamRight`
-* `on`: Fields to be used for checking equality of tuples between Left and Right. Can be of the format `on="fieldName"`, `on="fieldNameInLeft=fieldNameInRight"`, or `on="fieldName, otherFieldName=rightOtherFieldName"`.
-
-=== outerHashJoin Syntax
-
-[source,text]
-----
-outerHashJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  hashed=search(pets, q=type:cat, fl="personId,petName", sort="personId asc"),
-  on="personId"
-)
-
-outerHashJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  hashed=search(pets, q=type:cat, fl="ownerId,petName", sort="ownerId asc"),
-  on="personId=ownerId"
-)
-
-outerHashJoin(
-  search(people, q=*:*, fl="personId,name", sort="personId asc"),
-  hashed=select(
-    search(pets, q=type:cat, fl="ownerId,name", sort="ownerId asc"),
-    ownerId,
-    name as petName
-  ),
-  on="personId=ownerId"
-)
-----
-
-== parallel
-
-The `parallel` function wraps a streaming expression and sends it to N worker nodes to be processed in parallel.
-
-The parallel function requires that the `partitionKeys` parameter be provided to the underlying searches. The `partitionKeys` parameter will partition the search results (tuples) across the worker nodes. Tuples with the same values in the partitionKeys field will be shuffled to the same worker nodes.
-
-The parallel function maintains the sort order of the tuples returned by the worker nodes, so the sort criteria of the parallel function must match up with the sort order of the tuples returned by the workers.
-
-.Worker Collections
-[TIP]
-====
-The worker nodes can be from the same collection as the data, or they can be a different collection entirely, even one that only exists for parallel streaming expressions. A worker collection can be any SolrCloud collection that has the `/stream` handler configured. Unlike normal SolrCloud collections, worker collections don't have to hold any data. Worker collections can be empty collections that exist only to execute streaming expressions.
-====
-
-=== parallel Parameters
-
-* `collection`: Name of the worker collection to send the StreamExpression to.
-* `StreamExpression`: Expression to send to the worker collection.
-* `workers`: Number of workers in the worker collection to send the expression to.
-* `zkHost`: (Optional) The ZooKeeper connect string where the worker collection resides.
-* `sort`: The sort criteria for ordering tuples returned by the worker nodes.
-
-=== parallel Syntax
-
-[source,text]
-----
- parallel(workerCollection,
-          reduce(search(collection1, q=*:*, fl="id,a_s,a_i,a_f", sort="a_s desc", partitionKeys="a_s"),
-                 by="a_s",
-                 group(sort="a_f desc", n="4")),
-          workers="20",
-          zkHost="localhost:9983",
-          sort="a_s desc")
-----
-
-The expression above shows a `parallel` function wrapping a `reduce` function. This will cause the `reduce` function to be run in parallel across 20 worker nodes.
-
-== priority
-
-The `priority` function is a simple priority scheduler for the <<executor>> function. The `executor` function doesn't directly have a concept of task prioritization; instead it simply executes tasks in the order that they are read from it's underlying stream. The `priority` function provides the ability to schedule a higher priority task ahead of lower priority tasks that were submitted earlier.
-
-The `priority` function wraps two <<stream-sources.adoc#topic,topics>> that are both emitting tuples that contain streaming expressions to execute. The first topic is considered the higher priority task queue.
-
-Each time the `priority` function is called, it checks the higher priority task queue to see if there are any tasks to execute. If tasks are waiting in the higher priority queue then the priority function will emit the higher priority tasks. If there are no high priority tasks to run, the lower priority queue tasks are emitted.
-
-The `priority` function will only emit a batch of tasks from one of the queues each time it is called. This ensures that no lower priority tasks are executed until the higher priority queue has no tasks to run.
-
-=== priority Parameters
-
-* `topic expression`: (Mandatory) the high priority task queue
-* `topic expression`: (Mandatory) the lower priority task queue
-
-=== priority Syntax
-
-[source,text]
-----
-daemon(id="myDaemon",
-       executor(threads=10,
-                priority(topic(checkpointCollection, storedExpressions, q="priority:high", fl="id, expr_s", initialCheckPoint=0,id="highPriorityTasks"),
-                         topic(checkpointCollection, storedExpressions, q="priority:low", fl="id, expr_s", initialCheckPoint=0,id="lowPriorityTasks"))))
-----
-
-In the example above the `daemon` function is calling the executor iteratively. Each time it's called, the `executor` function will execute the tasks emitted by the `priority` function. The `priority` function wraps two topics. The first topic is the higher priority task queue, the second topics is the lower priority topic.
-
-== reduce
-
-The `reduce` function wraps an internal stream and groups tuples by common fields.
-
-Each tuple group is operated on as a single block by a pluggable reduce operation. The group operation provided with Solr implements distributed grouping functionality. The group operation also serves as an example reduce operation that can be referred to when building custom reduce operations.
-
-[IMPORTANT]
-====
-The reduce function relies on the sort order of the underlying stream. Accordingly the sort order of the underlying stream must be aligned with the group by field.
-====
-
-=== reduce Parameters
-
-* `StreamExpression`: (Mandatory)
-* `by`: (Mandatory) A comma separated list of fields to group by.
-* `Reduce Operation`: (Mandatory)
-
-=== reduce Syntax
-
-[source,text]
-----
-reduce(search(collection1, q=*:*, fl="id,a_s,a_i,a_f", sort="a_s asc, a_f asc"),
-       by="a_s",
-       group(sort="a_f desc", n="4")
-)
-----
-
-== rollup
-
-The `rollup` function wraps another stream function and rolls up aggregates over bucket fields. The rollup function relies on the sort order of the underlying stream to rollup aggregates one grouping at a time. Accordingly, the sort order of the underlying stream must match the fields in the `over` parameter of the rollup function.
-
-The rollup function also needs to process entire result sets in order to perform its aggregations. When the underlying stream is the `search` function, the `/export` handler can be used to provide full sorted result sets to the rollup function. This sorted approach allows the rollup function to perform aggregations over very high cardinality fields. The disadvantage of this approach is that the tuples must be sorted and streamed across the network to a worker node to be aggregated. For faster aggregation over low to moderate cardinality fields, the `facet` function can be used.
-
-=== rollup Parameters
-
-* `StreamExpression` (Mandatory)
-* `over`: (Mandatory) A list of fields to group by.
-* `metrics`: (Mandatory) The list of metrics to compute. Currently supported metrics are `sum(col)`, `avg(col)`, `min(col)`, `max(col)`, `count(*)`.
-
-=== rollup Syntax
-
-[source,text]
-----
-rollup(
-   search(collection1, q=*:*, fl="a_s,a_i,a_f", qt="/export", sort="a_s asc"),
-   over="a_s",
-   sum(a_i),
-   sum(a_f),
-   min(a_i),
-   min(a_f),
-   max(a_i),
-   max(a_f),
-   avg(a_i),
-   avg(a_f),
-   count(*)
-)
-----
-
-The example about shows the rollup function wrapping the search function. Notice that search function is using the `/export` handler to provide the entire result set to the rollup stream. Also notice that the search function's *sort param* matches up with the rollup's `over` parameter. This allows the rollup function to rollup the over the `a_s` field, one group at a time.
-
-== scoreNodes
-
-See section in <<graph-traversal.adoc#using-the-scorenodes-function-to-make-a-recommendation,graph traversal>>.
-
-== select
-
-The `select` function wraps a streaming expression and outputs tuples containing a subset or modified set of fields from the incoming tuples. The list of fields included in the output tuple can contain aliases to effectively rename fields. The `select` stream supports both operations and evaluators. One can provide a list of operations and evaluators to perform on any fields, such as `replace, add, if`, etc....
-
-=== select Parameters
-
-* `StreamExpression`
-* `fieldName`: name of field to include in the output tuple (can include multiple of these), such as `outputTuple[fieldName] = inputTuple[fieldName]`
-* `fieldName as aliasFieldName`: aliased field name to include in the output tuple (can include multiple of these), such as `outputTuple[aliasFieldName] = incomingTuple[fieldName]`
-* `replace(fieldName, value, withValue=replacementValue)`: if `incomingTuple[fieldName] == value` then `outgoingTuple[fieldName]` will be set to `replacementValue`. `value` can be the string "null" to replace a null value with some other value.
-* `replace(fieldName, value, withField=otherFieldName)`: if `incomingTuple[fieldName] == value` then `outgoingTuple[fieldName]` will be set to the value of `incomingTuple[otherFieldName]`. `value` can be the string "null" to replace a null value with some other value.
-
-=== select Syntax
-
-[source,text]
-----
-// output tuples with fields teamName, wins, losses, and winPercentages where a null value for wins or losses is translated to the value of 0
-select(
-  search(collection1, fl="id,teamName_s,wins,losses", q="*:*", sort="id asc"),
-  teamName_s as teamName,
-  wins,
-  losses,
-  replace(wins,null,withValue=0),
-  replace(losses,null,withValue=0),
-  if(eq(0,wins), 0, div(add(wins,losses), wins)) as winPercentage
-)
-----
-
-== sort
-
-The `sort` function wraps a streaming expression and re-orders the tuples. The sort function emits all incoming tuples in the new sort order. The sort function reads all tuples from the incoming stream, re-orders them using an algorithm with `O(nlog(n))` performance characteristics, where n is the total number of tuples in the incoming stream, and then outputs the tuples in the new sort order. Because all tuples are read into memory, the memory consumption of this function grows linearly with the number of tuples in the incoming stream.
-
-=== sort Parameters
-
-* `StreamExpression`
-* `by`: Sort criteria for re-ordering the tuples
-
-=== sort Syntax
-
-The expression below finds dog owners and orders the results by owner and pet name. Notice that it uses an efficient innerJoin by first ordering by the person/owner id and then re-orders the final output by the owner and pet names.
-
-[source,text]
-----
-sort(
-  innerJoin(
-    search(people, q=*:*, fl="id,name", sort="id asc"),
-    search(pets, q=type:dog, fl="owner,petName", sort="owner asc"),
-    on="id=owner"
-  ),
-  by="name asc, petName asc"
-)
-----
-
-== top
-
-The `top` function wraps a streaming expression and re-orders the tuples. The top function emits only the top N tuples in the new sort order. The top function re-orders the underlying stream so the sort criteria *does not* have to match up with the underlying stream.
-
-=== top Parameters
-
-* `n`: Number of top tuples to return.
-* `StreamExpression`
-* `sort`: Sort criteria for selecting the top N tuples.
-
-=== top Syntax
-
-The expression below finds the top 3 results of the underlying search. Notice that it reverses the sort order. The top function re-orders the results of the underlying stream.
-
-[source,text]
-----
-top(n=3,
-     search(collection1,
-            q="*:*",
-            qt="/export",
-            fl="id,a_s,a_i,a_f",
-            sort="a_f desc, a_i desc"),
-      sort="a_f asc, a_i asc")
-----
-
-== unique
-
-The `unique` function wraps a streaming expression and emits a unique stream of tuples based on the `over` parameter. The unique function relies on the sort order of the underlying stream. The `over` parameter must match up with the sort order of the underlying stream.
-
-The unique function implements a non-co-located unique algorithm. This means that records with the same unique `over` field do not need to be co-located on the same shard. When executed in the parallel, the `partitionKeys` parameter must be the same as the unique `over` field so that records with the same keys will be shuffled to the same worker.
-
-=== unique Parameters
-
-* `StreamExpression`
-* `over`: The unique criteria.
-
-=== unique Syntax
-
-[source,text]
-----
-unique(
-  search(collection1,
-         q="*:*",
-         qt="/export",
-         fl="id,a_s,a_i,a_f",
-         sort="a_f asc, a_i asc"),
-  over="a_f")
-----
-
-== update
-
-The `update` function wraps another functions and sends the tuples to a SolrCloud collection for indexing.
-
-=== update Parameters
-
-* `destinationCollection`: (Mandatory) The collection where the tuples will indexed.
-* `batchSize`: (Mandatory) The indexing batch size.
-* `StreamExpression`: (Mandatory)
-
-=== update Syntax
-
-[source,text]
-----
- update(destinationCollection,
-        batchSize=500,
-        search(collection1,
-               q=*:*,
-               fl="id,a_s,a_i,a_f,s_multi,i_multi",
-               sort="a_f asc, a_i asc"))
-
-----
-
-The example above sends the tuples returned by the `search` function to the `destinationCollection` to be indexed.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8330ba1d/solr/solr-ref-guide/src/stream-evaluator-reference.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/stream-evaluator-reference.adoc b/solr/solr-ref-guide/src/stream-evaluator-reference.adoc
new file mode 100644
index 0000000..eea5ede
--- /dev/null
+++ b/solr/solr-ref-guide/src/stream-evaluator-reference.adoc
@@ -0,0 +1,966 @@
+= Stream Evaluator Reference
+:page-shortname: stream-evaluator-reference
+:page-permalink: stream-evaluator-reference.html
+:page-tocclass: right
+:page-toclevels: 1
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+
+Stream evaluators are different then stream sources or stream decorators. Both
+stream sources and stream decorators return streams of tuples. Stream evaluators are more like
+a traditional function that evaluates its parameters and
+returns an result. That result can be a single value, array, map or other structure.
+
+Stream evaluators can be nested so that the output of an evaluator becomes the input
+for another evaluator.
+
+Stream evaluators can be called in different contexts. For example a stream evaluator
+can be called on its own or it can be called within the context of a streaming expression.
+
+== abs
+
+The `abs` function will return the absolute value of the provided single parameter. The `abs` function will fail to execute if the value is non-numeric. If a null value is found then null will be returned as the result.
+
+=== abs Parameters
+
+* `Field Name | Raw Number | Number Evaluator`
+
+=== abs Syntax
+
+The expressions below show the various ways in which you can use the `abs` evaluator. Only one parameter is accepted. Returns a numeric value.
+
+[source,text]
+----
+abs(1) // 1, not really a good use case for it
+abs(-1) // 1, not really a good use case for it
+abs(add(fieldA,fieldB)) // absolute value of fieldA + fieldB
+abs(fieldA) // absolute value of fieldA
+----
+
+== acos
+
+The `acos` function returns the trigonometric arccosine of a number.
+
+=== acos Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the arccosine of.
+
+=== acos Syntax
+
+[source,text]
+----
+acos(100.4)  // returns the arccosine of 100.4
+acos(fieldA) // returns the arccosine for fieldA.
+if(gt(fieldA,fieldB),sin(fieldA),sin(fieldB)) // if fieldA > fieldB then return the arccosine of fieldA, else return the arccosine of fieldB
+----
+
+== add
+
+The `add` function will take 2 or more numeric values and add them together. The `add` function will fail to execute if any of the values are non-numeric. If a null value is found then null will be returned as the result.
+
+=== add Parameters
+
+* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Number | Number Evaluator`
+* `......`
+* `Field Name | Raw Number | Number Evaluator`
+
+=== add Syntax
+
+The expressions below show the various ways in which you can use the `add` evaluator. The number and order of these parameters do not matter and is not limited except that at least two parameters are required. Returns a numeric value.
+
+[source,text]
+----
+add(1,2,3,4) // 1 + 2 + 3 + 4 == 10
+add(1,fieldA) // 1 + value of fieldA
+add(fieldA,1.4) // value of fieldA + 1.4
+add(fieldA,fieldB,fieldC) // value of fieldA + value of fieldB + value of fieldC
+add(fieldA,div(fieldA,fieldB)) // value of fieldA + (value of fieldA / value of fieldB)
+add(fieldA,if(gt(fieldA,fieldB),fieldA,fieldB)) // if fieldA > fieldB then fieldA + fieldA, else fieldA + fieldB
+----
+
+== analyze
+
+The `analyze` function analyzes text using a Lucene/Solr analyzer and returns a list of tokens
+emitted by the analyzer. The `analyze` function can be called on its own or within the
+`select` and `cartasianProduct` Streaming Expressions.
+
+=== analyze Parameters
+
+* `Field Name` | `Raw Text`: Either the field in a tuple or the raw text to be analyzed.
+* `Analyzer Field Name`: The field name of the analyzer to use to analyze the text.
+
+=== analyze Syntax
+
+The expressions below show the various ways in which you can use the `analyze` evaluator.
+
+* Analyze the raw text: `analyze("hello world", analyzerField)`
+* Analyze a text field within a `select` expression. This will annotate the tuples with output of the analyzer: `select(expr, analyze(textField, analyzerField) as outField)`
+* Analyze a text field with a `cartesianProduct` expression. This will stream each token emitted by the analyzer in its own tuple: `cartesianProduct(expr, analyze(textField, analyzer) as outField)`
+
+== and
+
+The `and` function will return the logical AND of at least 2 boolean parameters. The function will fail to execute if any parameters are non-boolean or null. Returns a boolean value.
+
+=== and Parameters
+
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `......`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+
+=== and Syntax
+
+The expressions below show the various ways in which you can use the `and` evaluator. At least two parameters are required, but there is no limit to how many you can use.
+
+[source,text]
+----
+and(true,fieldA) // true && fieldA
+and(fieldA,fieldB) // fieldA && fieldB
+and(or(fieldA,fieldB),fieldC) // (fieldA || fieldB) && fieldC
+and(fieldA,fieldB,fieldC,or(fieldD,fieldE),fieldF)
+----
+
+== anova
+
+The `anova` function calculates the https://en.wikipedia.org/wiki/Analysis_of_variance[analysis of variance] for two or more numeric arrays.
+
+=== anova Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array` ... (two or more)
+
+=== anova Syntax
+
+[source,text]
+anova(numericArray1, numericArray2) // calculates ANOVA for two numeric arrays
+anova(numericArray1, numericArray2, numericArray2) // calculates ANOVA for three numeric arrays
+
+== array
+
+The `array` function returns an array of numerics or other objects including other arrays.
+
+=== array Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric` | `array` ...
+
+=== array Syntax
+
+[source,text]
+array(1, 2, 3)  // Array of numerics
+array(array(1,2,3), array(4,5,6)) // Array of arrays
+
+== asin
+The `asin` function returns the trigonometric arcsine of a number.
+
+=== asin Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the arcsine of.
+
+=== asin Syntax
+
+[source,text]
+----
+asin(100.4)  // returns the sine of 100.4
+asine(fieldA) // returns the sine for fieldA.
+if(gt(fieldA,fieldB),asin(fieldA),asin(fieldB)) // if fieldA > fieldB then return the asine of fieldA, else return the asine of fieldB
+----
+
+== atan
+
+The `atan` function returns the trigonometric arctangent of a number.
+
+=== atan Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the arctangent of.
+
+=== atan Syntax
+
+[source,text]
+----
+atan(100.4)  // returns the arctangent of 100.4
+atan(fieldA) // returns the arctangent for fieldA.
+if(gt(fieldA,fieldB),atan(fieldA),atan(fieldB)) // if fieldA > fieldB then return the arctanget of fieldA, else return the arctangent of fieldB
+----
+
+== cbrt
+
+The `cbrt` function returns the trigonometric cube root of a number.
+
+=== cbrt Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the cube root of.
+
+=== cbrt Syntax
+
+[source,text]
+----
+cbrt(100.4)  // returns the square root of 100.4
+cbrt(fieldA) // returns the square root for fieldA.
+if(gt(fieldA,fieldB),cbrt(fieldA),cbrt(fieldB)) // if fieldA > fieldB then return the cbrt of fieldA, else return the cbrt of fieldB
+----
+
+== ceil
+The `ceil` function rounds a decimal value to the next highest whole number.
+
+=== ceil Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The decimal to round up.
+
+=== ceil Syntax
+
+The expressions below show the various ways in which you can use the `ceil` evaluator.
+
+[source,text]
+----
+ceil(100.4) // returns 101.
+ceil(fieldA) // returns the next highest whole number for fieldA.
+if(gt(fieldA,fieldB),ceil(fieldA),ceil(fieldB)) // if fieldA > fieldB then return the ceil of fieldA, else return the ceil of fieldB.
+----
+
+== col
+
+The `col` function returns a numeric array from a list of Tuples. The `col`
+function is used to create numeric arrays from stream sources.
+
+=== col Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `list of Tuples`
+* `field name`: The field to create the array from.
+
+
+=== col Syntax
+
+[source,text]
+col(tupleList, fieldName)
+
+== conv
+
+The `conv` function returns the https://en.wikipedia.org/wiki/Convolution[convolution] of two numeric arrays.
+
+=== conv Parameters
+
+* `numeric array`
+* `numeric array`
+
+=== conv Syntax
+
+[source,text]
+conv(numericArray1, numericArray2)
+
+== copyOf
+
+The `copyOf` function creates a copy of a numeric array.
+
+=== copyOf Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `length`: The length of the copied array. The returned array will be right padded with zeros if the length parameter exceeds the size of the original array.
+
+=== copyOf Syntax
+
+[source,text]
+copyOf(numericArray, length)
+
+== copyOfRange
+
+The `copyOfRange` function creates a copy of a range of a numeric array.
+
+=== copyOfRange Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `start index`
+* `end index`
+
+=== copyOfRange Syntax
+
+[source,text]
+copyOfRange(numericArray, startIndex, endIndex)
+
+== corr
+
+The `corr` function returns the Pearson Product Moment Correlation of two numeric arrays.
+
+=== corr Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `numeric array`
+
+=== corr Returns
+
+double between -1 and 1
+
+=== corr Synax
+
+[source,text]
+corr(numericArray1, numericArray2)
+
+== cos
+The `cos` function returns the trigonometric cosine of a number.
+
+=== cos Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the hyperbolic cosine of.
+
+=== cos Syntax
+
+[source,text]
+----
+cos(100.4)  // returns the arccosine of 100.4
+cos(fieldA) // returns the arccosine for fieldA.
+if(gt(fieldA,fieldB),cos(fieldA),cos(fieldB)) // if fieldA > fieldB then return the arccosine of fieldA, else return the cosine of fieldB
+----
+
+== cov
+
+The `cov` function returns the covariance of two numeric arrays.
+
+=== cov Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `numeric array`
+
+=== cov Syntax
+
+[source,text]
+cov(numericArray, numericArray)
+
+== describe
+
+The `describe` function returns a tuple containing the descriptive statistics for an array.
+
+=== describe Parameters
+
+* `numeric array`
+
+=== describe Syntax
+
+[source,text]
+describe(numericArray)
+
+== distance
+
+The `distance` function calculates the Euclidian distance of two numeric arrays.
+
+=== distance Parameters
+
+* `numeric array`
+* `numeric array`
+
+=== distance Syntax
+
+[source,text]
+distance(numericArray1, numuericArray2))
+
+== div
+
+The `div` function will take two numeric values and divide them. The function will fail to execute if any of the values are non-numeric or null, or the 2nd value is 0. Returns a numeric value.
+
+=== div Parameters
+
+* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Number | Number Evaluator`
+
+=== div Syntax
+
+The expressions below show the various ways in which you can use the `div` evaluator. The first value will be divided by the second and as such the second cannot be 0.
+
+[source,text]
+----
+div(1,2) // 1 / 2
+div(1,fieldA) // 1 / fieldA
+div(fieldA,1.4) // fieldA / 1.4
+div(fieldA,add(fieldA,fieldB)) // fieldA / (fieldA + fieldB)
+----
+
+== eor
+
+The `eor` function will return the logical exclusive or of at least two boolean parameters. The function will fail to execute if any parameters are non-boolean or null. Returns a boolean value.
+
+=== eor Parameters
+
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `......`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+
+=== eor Syntax
+
+The expressions below show the various ways in which you can use the `eor` evaluator. At least two parameters are required, but there is no limit to how many you can use.
+
+[source,text]
+----
+eor(true,fieldA) // true iff fieldA is false
+eor(fieldA,fieldB) // true iff either fieldA or fieldB is true but not both
+eor(eq(fieldA,fieldB),eq(fieldC,fieldD)) // true iff either fieldA == fieldB or fieldC == fieldD but not both
+----
+
+== eq
+
+The `eq` function will return whether all the parameters are equal, as per Java's standard `equals(...)` function. The function accepts parameters of any type, but will fail to execute if all the parameters are not of the same type. That is, all are Boolean, all are String, all are Numeric. If any any parameters are null and there is at least one parameter that is not null then false will be returned. Returns a boolean value.
+
+=== eq Parameters
+
+* `Field Name | Raw Value | Evaluator`
+* `Field Name | Raw Value | Evaluator`
+* `......`
+* `Field Name | Raw Value | Evaluator`
+
+=== eq Syntax
+
+The expressions below show the various ways in which you can use the `eq` evaluator.
+
+[source,text]
+----
+eq(1,2) // 1 == 2
+eq(1,fieldA) // 1 == fieldA
+eq(fieldA,val(foo)) fieldA == "foo"
+eq(add(fieldA,fieldB),6) // fieldA + fieldB == 6
+----
+
+== finddelay
+
+The `finddelay` function performs a cross-correlation between two numeric arrays and returns the delay.
+
+=== finddelay Parameters
+
+* `numeric array`
+* `numeric array`
+
+=== finddelay Syntax
+
+[source,text]
+finddelay(numericArray1, numericArray2)
+
+== floor
+The `floor` function rounds a decimal value to the next lowest whole number.
+
+=== floor Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The decimal to round down.
+
+=== floor Syntax
+
+The expressions below show the various ways in which you can use the `floor` evaluator.
+
+[source,text]
+----
+floor(100.4) // returns 100.
+ceil(fieldA) // returns the next lowestt whole number for fieldA.
+if(gt(fieldA,fieldB),floor(fieldA),floor(fieldB)) // if fieldA > fieldB then return the floor of fieldA, else return the floor of fieldB.
+----
+
+== gt
+
+The `gt` function will return whether the first parameter is greater than the second parameter. The function accepts numeric or string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.
+
+=== gt Parameters
+
+* `Field Name | Raw Value | Evaluator`
+* `Field Name | Raw Value | Evaluator`
+
+=== gt Syntax
+
+The expressions below show the various ways in which you can use the `gt` evaluator.
+
+[source,text]
+----
+gt(1,2) // 1 > 2
+gt(1,fieldA) // 1 > fieldA
+gt(fieldA,val(foo)) // fieldA > "foo"
+gt(add(fieldA,fieldB),6) // fieldA + fieldB > 6
+----
+
+== gteq
+
+The `gteq` function will return whether the first parameter is greater than or equal to the second parameter. The function accepts numeric and string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.
+
+=== gteq Parameters
+
+* `Field Name | Raw Value | Evaluator`
+* `Field Name | Raw Value | Evaluator`
+
+=== gteq Syntax
+
+The expressions below show the various ways in which you can use the `gteq` evaluator.
+
+[source,text]
+----
+gteq(1,2) // 1 >= 2
+gteq(1,fieldA) // 1 >= fieldA
+gteq(fieldA,val(foo)) fieldA >= "foo"
+gteq(add(fieldA,fieldB),6) // fieldA + fieldB >= 6
+----
+
+== hist
+
+The `hist` function creates a histogram from a numeric array. The hist function is designed
+to work with continuous variables.
+
+=== hist Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `bins`: The number of bins in the histogram. Each returned tuple contains
+summary statistics for the observations that were within the bin.
+
+=== hist Sytnax
+
+[source,text]
+hist(numericArray, bins)
+
+== hsin
+The `hsin` function returns the trigonometric hyperbolic sine of a number.
+
+=== hsin Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the hyperbolic sine of.
+
+=== hsin Syntax
+
+[source,text]
+----
+hsin(100.4)  // returns the hsine of 100.4
+hsin(fieldA) // returns the hsine for fieldA.
+if(gt(fieldA,fieldB),sin(fieldA),sin(fieldB)) // if fieldA > fieldB then return the hsine of fieldA, else return the hsine of fieldB
+----
+
+== if
+
+The `if` function works like a standard conditional if/then statement. If the first parameter is true, then the second parameter will be returned, else the third parameter will be returned. The function accepts a boolean as the first parameter and anything as the second and third parameters. An error will occur if the first parameter is not a boolean or is null.
+
+=== if Parameters
+
+* `Field Name | Raw Value | Boolean Evaluator`
+* `Field Name | Raw Value | Evaluator`
+* `Field Name | Raw Value | Evaluator`
+
+=== if Syntax
+
+The expressions below show the various ways in which you can use the `if` evaluator.
+
+[source,text]
+----
+if(fieldA,fieldB,fieldC) // if fieldA is true then fieldB else fieldC
+if(gt(fieldA,5), fieldA, 5) // if fieldA > 5 then fieldA else 5
+if(eq(fieldB,null), null, div(fieldA,fieldB)) // if fieldB is null then null else fieldA / fieldB
+----
+
+== length
+
+The `length` function returns the length of a numeric array.
+
+=== length Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+
+=== length Syntax
+
+[source,text]
+length(numericArray)
+
+== log
+
+The `log` function will return the natural log of the provided single parameter. The `log` function will fail to execute if the value is non-numeric. If a null value is found, then null will be returned as the result.
+
+=== log Parameters
+
+* `Field Name | Raw Number | Number Evaluator`
+
+=== log Syntax
+
+The expressions below show the various ways in which you can use the `log` evaluator. Only one parameter is accepted. Returns a numeric value.
+
+[source,text]
+----
+log(100)
+log(add(fieldA,fieldB))
+log(fieldA)
+----
+
+== lt
+
+The `lt` function will return whether the first parameter is less than the second parameter. The function accepts numeric or string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.
+
+=== lt Parameters
+
+* `Field Name | Raw Value | Evaluator`
+* `Field Name | Raw Value | Evaluator`
+
+=== lt Syntax
+
+The expressions below show the various ways in which you can use the `lt` evaluator.
+
+[source,text]
+----
+lt(1,2) // 1 < 2
+lt(1,fieldA) // 1 < fieldA
+lt(fieldA,val(foo)) fieldA < "foo"
+lt(add(fieldA,fieldB),6) // fieldA + fieldB < 6
+----
+
+== lteq
+
+The `lteq` function will return whether the first parameter is less than or equal to the second parameter. The function accepts numeric and string parameters, but will fail to execute if all the parameters are not of the same type. That is, all are String or all are Numeric. If any any parameters are null then an error will be raised. Returns a boolean value.
+
+=== lteq Parameters
+
+* `Field Name | Raw Value | Evaluator`
+* `Field Name | Raw Value | Evaluator`
+
+=== lteq Syntax
+
+The expressions below show the various ways in which you can use the `lteq` evaluator.
+
+[source,text]
+----
+lteq(1,2) // 1 <= 2
+lteq(1,fieldA) // 1 <= fieldA
+lteq(fieldA,val(foo)) fieldA <= "foo"
+lteq(add(fieldA,fieldB),6) // fieldA + fieldB <= 6
+----
+
+== mod
+The `mod` function returns the remainder (modulo) of the first parameter divided by the second parameter.
+
+=== mod Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: Parameter 1
+* `Field Name | Raw Number | Number Evaluator`: Parameter 2
+
+=== mod Syntax
+
+The expressions below show the various ways in which you can use the `mod` evaluator.
+
+[source,text]
+----
+mod(100,3) // returns the remainder of 100 / 3 .
+mod(100,fieldA) // returns the remainder of 100 divided by the value of fieldA.
+mod(fieldA,1.4) // returns the remainder of fieldA divided by 1.4.
+if(gt(fieldA,fieldB),mod(fieldA,fieldB),mod(fieldB,fieldA)) // if fieldA > fieldB then return the remainder of fieldA/fieldB, else return the remainder of fieldB/fieldA.
+----
+
+== movingAvg
+
+The `movingAvg` function calculates a https://en.wikipedia.org/wiki/Moving_average[moving average] over an array of numbers.
+
+=== movingAvg Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `window size`: The array returned will be smaller than this value.
+
+=== movingAvg Syntax
+
+[source,text]
+movingAverage(numericArray, 30)
+
+== mult
+
+The `mult` function will take two or more numeric values and multiply them together. The `mult` function will fail to execute if any of the values are non-numeric. If a null value is found then null will be returned as the result.
+
+=== mult Parameters
+
+* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Number | Number Evaluator`
+* `......`
+* `Field Name | Raw Number | Number Evaluator`
+
+=== mult Syntax
+
+The expressions below show the various ways in which you can use the `mult` evaluator. The number and order of these parameters do not matter and is not limited except that at least two parameters are required. Returns a numeric value.
+
+[source,text]
+----
+mult(1,2,3,4) // 1 * 2 * 3 * 4
+mult(1,fieldA) // 1 * value of fieldA
+mult(fieldA,1.4) // value of fieldA * 1.4
+mult(fieldA,fieldB,fieldC) // value of fieldA * value of fieldB * value of fieldC
+mult(fieldA,div(fieldA,fieldB)) // value of fieldA * (value of fieldA / value of fieldB)
+mult(fieldA,if(gt(fieldA,fieldB),fieldA,fieldB)) // if fieldA > fieldB then fieldA * fieldA, else fieldA * fieldB
+----
+
+== normalize
+
+The `normalize` function normalizes a numeric array so that values within the array
+have a mean of 0 and standard deviation of 1.
+
+=== normalize Parameters
+
+* `numeric array`
+
+=== normalize Syntax
+
+[source,text]
+normalize(numericArray)
+
+== not
+
+The `not` function will return the logical NOT of a single boolean parameter. The function will fail to execute if the parameter is non-boolean or null. Returns a boolean value.
+
+=== not Parameters
+
+* `Field Name | Raw Boolean | Boolean Evaluator`
+
+=== not Syntax
+
+The expressions below show the various ways in which you can use the `not` evaluator. Only one parameter is allowed.
+
+[source,text]
+----
+not(true) // false
+not(fieldA) // true if fieldA is false else false
+not(eq(fieldA,fieldB)) // true if fieldA != fieldB
+----
+
+== or
+
+The `or` function will return the logical OR of at least 2 boolean parameters. The function will fail to execute if any parameters are non-boolean or null. Returns a boolean value.
+
+=== or Parameters
+
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `......`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+
+=== or Syntax
+
+The expressions below show the various ways in which you can use the `or` evaluator. At least two parameters are required, but there is no limit to how many you can use.
+
+[source,text]
+----
+or(true,fieldA) // true || fieldA
+or(fieldA,fieldB) // fieldA || fieldB
+or(and(fieldA,fieldB),fieldC) // (fieldA && fieldB) || fieldC
+or(fieldA,fieldB,fieldC,and(fieldD,fieldE),fieldF)
+----
+
+== predict
+
+The `predict` function predicts the value of an dependent variable based on
+the output of the regress function.
+
+=== predict Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `regress output`
+* `numeric predictor`
+
+=== predict Syntax
+
+[source,text]
+predict(regressOutput, predictor)
+
+== pow
+The `pow` function returns the value of its first parameter raised to the power of its second parameter.
+
+=== pow Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: Parameter 1
+* `Field Name | Raw Number | Number Evaluator`: Parameter 2
+
+=== pow Syntax
+
+The expressions below show the various ways in which you can use the `pow` evaluator.
+
+[source,text]
+----
+pow(2,3) // returns 2 raised to the 3rd power.
+pow(4,fieldA) // returns 4 raised by the value of fieldA.
+pow(fieldA,1.4) // returns the value of fieldA raised by 1.4.
+if(gt(fieldA,fieldB),pow(fieldA,fieldB),pow(fieldB,fieldA)) // if fieldA > fieldB then raise fieldA by fieldB, else raise fieldB by fieldA.
+----
+
+== rank
+
+The `rank` performs a rank transformation on a numeric array.
+
+=== rank Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+
+=== rank Syntax
+
+[source,text]
+rank(numericArray)
+
+== raw
+
+The `raw` function will return whatever raw value is the parameter. This is useful for cases where you want to use a string as part of another evaluator.
+
+=== raw Parameters
+
+* `Raw Value`
+
+=== raw Syntax
+
+The expressions below show the various ways in which you can use the `raw` evaluator. Whatever is inside will be returned as-is. Internal evaluators are considered strings and are not evaluated.
+
+[source,text]
+----
+raw(foo) // "foo"
+raw(count(*)) // "count(*)"
+raw(45) // 45
+raw(true) // "true" (note: this returns the string "true" and not the boolean true)
+eq(raw(fieldA), fieldA) // true if the value of fieldA equals the string "fieldA"
+----
+
+== regress
+
+The `regress` function performs a simple regression on two numeric arrays.
+
+The result of this expression is also used by the `predict` function.
+
+=== regress Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `numeric array`
+
+=== regress Syntax
+
+[source,text]
+regress(numericArray1, numericArray2)
+
+== rev
+
+The `rev` function reverses the order of a numeric array.
+
+=== rev Parameters
+
+* `numeric array`
+
+=== rev Syntax
+
+[source,text]
+rev(numericArray)
+
+== round
+
+The `round` function returns the closest whole number to the argument
+
+=== round Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the square root of.
+
+=== round Syntax
+
+[source,text]
+----
+round(100.4)
+round(fieldA)
+if(gt(fieldA,fieldB),sqrt(fieldA),sqrt(fieldB)) // if fieldA > fieldB then return the round of fieldA, else return the round of fieldB
+----
+
+== scale
+
+The `scale` function multiplies all the elements of an array by a number.
+
+=== scale Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `number`
+* `numeric array`
+
+=== scale Syntax
+
+[source,text]
+scale(number, numericArray)
+
+== sequence
+
+The `sequence` function returns an array of numbers based on its parameters.
+
+=== sequence Parameters
+
+//TODO 7.1 - fill in details of Parameters
+* `length`
+* `start`
+* `stride`
+
+=== sequence Syntax
+
+[source,text]
+sequence(100, 0, 1) // Returns a sequence of length 100, starting from 0 with a stride of 1.
+
+== sin
+The `sin` function returns the trigonometric sine of a number.
+
+=== sin Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the sine of.
+
+=== sin Syntax
+
+[source,text]
+----
+sin(100.4)  // returns the sine of 100.4
+sine(fieldA) // returns the sine for fieldA.
+if(gt(fieldA,fieldB),sin(fieldA),sin(fieldB)) // if fieldA > fieldB then return the sine of fieldA, else return the sine of fieldB
+----
+
+== sqrt
+
+The `sqrt` function returns the trigonometric square root of a number.
+
+=== sqrt Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: The value to return the square root of.
+
+=== sqrt Syntax
+
+[source,text]
+----
+sqrt(100.4)  // returns the square root of 100.4
+sqrt(fieldA) // returns the square root for fieldA.
+if(gt(fieldA,fieldB),sqrt(fieldA),sqrt(fieldB)) // if fieldA > fieldB then return the sqrt of fieldA, else return the sqrt of fieldB
+----
+
+== sub
+
+The `sub` function will take 2 or more numeric values and subtract them, from left to right. The sub function will fail to execute if any of the values are non-numeric. If a null value is found then null will be returned as the result.
+
+=== sub Parameters
+
+* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Number | Number Evaluator`
+* `......`
+* `Field Name | Raw Number | Number Evaluator`
+
+=== sub Syntax
+
+The expressions below show the various ways in which you can use the `sub` evaluator. The number of these parameters does not matter and is not limited except that at least two parameters are required. Returns a numeric value.
+
+[source,text]
+----
+sub(1,2,3,4) // 1 - 2 - 3 - 4
+sub(1,fieldA) // 1 - value of fieldA
+sub(fieldA,1.4) // value of fieldA - 1.4
+sub(fieldA,fieldB,fieldC) // value of fieldA - value of fieldB - value of fieldC
+sub(fieldA,div(fieldA,fieldB)) // value of fieldA - (value of fieldA / value of fieldB)
+if(gt(fieldA,fieldB),sub(fieldA,fieldB),sub(fieldB,fieldA)) // if fieldA > fieldB then fieldA - fieldB, else fieldB - field
+----