Skip to content

Apache Lucene open-source search software

Ref Guide: clean up minor typos; part of 7.0 pre-release review

Cassandra Targett1b88435723a5
diff --git a/solr/solr-ref-guide/src/collapse-and-expand-results.adoc b/solr/solr-ref-guide/src/collapse-and-expand-results.adoc
index 3a99897967f..23d383994b9 100644
--- a/solr/solr-ref-guide/src/collapse-and-expand-results.adoc
+++ b/solr/solr-ref-guide/src/collapse-and-expand-results.adoc
@@ -33,24 +33,24 @@ The `CollapsingQParser` is really a _post filter_ that provides more performant
The CollapsingQParser accepts the following local parameters:
-field::
+`field`::
The field that is being collapsed on. The field must be a single valued String, Int or Float-type of field.
-min or max::
+`min` or `max`::
Selects the group head document for each group based on which document has the min or max value of the specified numeric field or <<function-queries.adoc#function-queries,function query>>.
+
At most only one of the `min`, `max`, or `sort` (see below) parameters may be specified.
+
If none are specified, the group head document of each group will be selected based on the highest scoring document in that group. The default is none.
-sort::
+`sort`::
Selects the group head document for each group based on which document comes first according to the specified <<common-query-parameters.adoc#sort-parameter,sort string>>.
+
At most only one of the `min`, `max`, (see above) or `sort` parameters may be specified.
+
If none are specified, the group head document of each group will be selected based on the highest scoring document in that group. The default is none.
-nullPolicy::
+`nullPolicy`::
There are three available null policies:
+
* `ignore`: removes documents with a null value in the collapse field. This is the default.
@@ -59,14 +59,14 @@ There are three available null policies:
+
The default is `ignore`.
-hint::
+`hint`::
Currently there is only one hint available: `top_fc`, which stands for top level FieldCache.
+
The `top_fc` hint is only available when collapsing on String fields. `top_fc` usually provides the best query time speed but takes the longest to warm on startup or following a commit. `top_fc` will also result in having the collapsed field cached in memory twice if it's used for faceting or sorting. For very high cardinality (high distinct count) fields, `top_fc` may not fare so well.
+
The default is none.
-size::
+`size`::
Sets the initial size of the collapse data structures when collapsing on a *numeric field only*.
+
The data structures used for collapsing grow dynamically when collapsing on numeric fields. Setting the size above the number of results expected in the result set will eliminate the resizing cost.
@@ -146,14 +146,14 @@ Inside the expanded section there is a _map_ with each group head pointing to th
The ExpandComponent has the following parameters:
-expand.sort::
+`expand.sort`::
Orders the documents within the expanded groups. The default is `score desc`.
-expand.rows::
+`expand.rows`::
The number of rows to display in each group. The default is 5 rows.
-expand.q::
+`expand.q`::
Overrides the main query (`q`), determines which documents to include in the main group. The default is to use the main query.
-expand.fq::
+`expand.fq`::
Overrides main filter queries (`fq`), determines which documents to include in the main group. The default is to use the main filter queries.
diff --git a/solr/solr-ref-guide/src/faceting.adoc b/solr/solr-ref-guide/src/faceting.adoc
index 4b8ce4647a8..f28af7d1413 100644
--- a/solr/solr-ref-guide/src/faceting.adoc
+++ b/solr/solr-ref-guide/src/faceting.adoc
@@ -259,7 +259,7 @@ Using the "`bin/solr -e techproducts`" example, A query URL like this one will r
http://localhost:8983/solr/techproducts/select?q=*:*&facet.pivot=cat,popularity,inStock
&facet.pivot=popularity,cat&facet=true&facet.field=cat&facet.limit=5&rows=0&facet.pivot.mincount=2
----
-+
+
[source,json]
----
{ "facet_counts":{
@@ -551,7 +551,7 @@ For example:
The initial and end values cannot be empty.
-If the interval needs to be unbounded, the special character `*` can be used for both, start and end limit. When using this special character, the start syntax options (`(` anAd `[`), and end syntax options (`)` and `]`) will be treated the same. `[*,*]` will include all documents with a value in the field.
+If the interval needs to be unbounded, the special character `\*` can be used for both, start and end, limits. When using this special character, the start syntax options (`(` and `[`), and end syntax options (`)` and `]`) will be treated the same. `[*,*]` will include all documents with a value in the field.
The interval limits may be strings but there is no need to add quotes. All the text until the comma will be treated as the start limit, and the text after that will be the end limit. For example: `[Buenos Aires,New York]`. Keep in mind that a string-like comparison will be done to match documents in string intervals (case-sensitive). The comparator can't be changed.
diff --git a/solr/solr-ref-guide/src/major-changes-in-solr-7.adoc b/solr/solr-ref-guide/src/major-changes-in-solr-7.adoc
index 6536543da01..29682df4c4a 100644
--- a/solr/solr-ref-guide/src/major-changes-in-solr-7.adoc
+++ b/solr/solr-ref-guide/src/major-changes-in-solr-7.adoc
@@ -54,7 +54,9 @@ See the section <<solrcloud-autoscaling.adoc#solrcloud-autoscaling,SolrCloud Aut
=== Other Features & Enhancements
+// TODO 7.1 - update link to docs when complete
* The Analytics Component has been refactored.
+** The documentation for this component is in progress; until it is available, please refer to https://issues.apache.org/jira/browse/SOLR-11144[SOLR-11144] for more details.
* There were several other new features released in earlier 6.x releases, which you may have missed:
** <<learning-to-rank.adoc#learning-to-rank,Learning to Rank>>
diff --git a/solr/solr-ref-guide/src/near-real-time-searching.adoc b/solr/solr-ref-guide/src/near-real-time-searching.adoc
index 6556398e200..9bd71183070 100644
--- a/solr/solr-ref-guide/src/near-real-time-searching.adoc
+++ b/solr/solr-ref-guide/src/near-real-time-searching.adoc
@@ -22,7 +22,7 @@ Near Real Time (NRT) search means that documents are available for search almost
This allows additions and updates to documents to be seen in 'near' real time. Solr does not block updates while a commit is in progress. Nor does it wait for background merges to complete before opening a new search of indexes and returning.
-With NRT, you can modify a `commit` command to be a *soft commit*, which avoids parts of a standard commit that can be costly. You will still want to do standard commits to ensure that documents are in stable storage, but *soft commits* let you see a very near real time view of the index in the meantime.
+With NRT, you can modify a `commit` command to be a *soft commit*, which avoids parts of a standard commit that can be costly. You will still want to do standard commits to ensure that documents are in stable storage, but soft commits let you see a very near real time view of the index in the meantime.
However, pay special attention to cache and autowarm settings as they can have a significant impact on NRT performance.
@@ -30,9 +30,9 @@ However, pay special attention to cache and autowarm settings as they can have a
A commit operation makes index changes visible to new search requests. A *hard commit* uses the transaction log to get the id of the latest document changes, and also calls `fsync` on the index files to ensure they have been flushed to stable storage and no data loss will result from a power failure. The current transaction log is closed and a new one is opened. See the "transaction log" discussion below for data loss issues.
-A *soft commit* is much faster since it only makes index changes visible and does not `fsync` index files, or write a new index descriptor or start a new transaction log. Search collections that have NRT requirements (that want index changes to be quickly visible to searches) will want to soft commit often but hard commit less frequently. A softCommit may be "less expensive", but it is not free, since it can slow throughput. See the "transaction log" discussion below for data loss issues.
+A soft commit is much faster since it only makes index changes visible and does not `fsync` index files, or write a new index descriptor or start a new transaction log. Search collections that have NRT requirements (that want index changes to be quickly visible to searches) will want to soft commit often but hard commit less frequently. A softCommit may be "less expensive", but it is not free, since it can slow throughput. See the "transaction log" discussion below for data loss issues.
-An *optimize* is like a *hard commit* except that it forces all of the index segments to be merged into a single segment first. Depending on the use, this operation should be performed infrequently (e.g., nightly), if at all, since it involves reading and re-writing the entire index. Segments are normally merged over time anyway (as determined by the merge policy), and optimize just forces these merges to occur immediately.
+An *optimize* is like a hard commit except that it forces all of the index segments to be merged into a single segment first. Depending on the use, this operation should be performed infrequently (e.g., nightly), if at all, since it involves reading and re-writing the entire index. Segments are normally merged over time anyway (as determined by the merge policy), and optimize just forces these merges to occur immediately.
Soft commit takes uses two parameters: `maxDocs` and `maxTime`.
@@ -46,7 +46,7 @@ Use `maxDocs` and `maxTime` judiciously to fine-tune your commit strategies.
=== Transaction Logs (tlogs)
-Transaction logs are a "rolling window" of at least the last `N` (default 100) documents indexed. Tlogs are configured in solrconfig.xml, including the value of `N`. The current transaction log is closed and a new one opened each time any variety of hard commit occurs. Soft commits have no effect on the transaction log.
+Transaction logs are a "rolling window" of at least the last `N` (default 100) documents indexed. Tlogs are configured in `solrconfig.xml`, including the value of `N`. The current transaction log is closed and a new one opened each time any variety of hard commit occurs. Soft commits have no effect on the transaction log.
When tlogs are enabled, documents being added to the index are written to the tlog before the indexing call returns to the client. In the event of an un-graceful shutdown (power loss, JVM crash, `kill -9` etc) any documents written to the tlog that was open when Solr stopped are replayed on startup.
diff --git a/solr/solr-ref-guide/src/query-re-ranking.adoc b/solr/solr-ref-guide/src/query-re-ranking.adoc
index b633064214f..64ffc9425db 100644
--- a/solr/solr-ref-guide/src/query-re-ranking.adoc
+++ b/solr/solr-ref-guide/src/query-re-ranking.adoc
@@ -21,7 +21,7 @@
Query Re-Ranking allows you to run a simple query (A) for matching documents and then re-rank the top N documents using the scores from a more complex query (B).
-Since the more costly ranking from query B is only applied to the top _N_ documents it will have less impact on performance then just using the complex query B by itself. The trade off is that documents which score very low using the simple query A may not be considered during the re-ranking phase, even if they would score very highly using query B.
+Since the more costly ranking from query B is only applied to the top _N_ documents, it will have less impact on performance then just using the complex query B by itself. The trade off is that documents which score very low using the simple query A may not be considered during the re-ranking phase, even if they would score very highly using query B.
== Specifying a Ranking Query
diff --git a/solr/solr-ref-guide/src/response-writers.adoc b/solr/solr-ref-guide/src/response-writers.adoc
index bc8657a5756..acdc617c9f3 100644
--- a/solr/solr-ref-guide/src/response-writers.adoc
+++ b/solr/solr-ref-guide/src/response-writers.adoc
@@ -94,9 +94,6 @@ This parameter controls the output format of NamedLists, where order is more imp
The `json.nl` parameter takes the following values:
-
-|json.nl Parameter setting |Example output for `NamedList("a"=1, "bar"="foo", null=3, null=null)` |Description
-
`flat`::
The default. NamedList is represented as a flat array, alternating names and values.
+
@@ -107,17 +104,17 @@ NamedList is represented as a JSON object. Although this is the simplest mapping
+
With input of `NamedList("a"=1, "bar"="foo", null=3, null=null)`, the output would be `{"a":1, "bar":"foo", "":3, "":null}`.
-arrarr::
+`arrarr`::
NamedList is represented as an array of two element arrays.
+
With input of `NamedList("a"=1, "bar"="foo", null=3, null=null)`, the output would be `[["a",1], ["bar","foo"], [null,3], [null,null]]`.
-arrmap::
+`arrmap`::
NamedList is represented as an array of JSON objects.
+
With input of `NamedList("a"=1, "bar"="foo", null=3, null=null)`, the output would be `[{"a":1}, {"b":2}, 3, null]`.
-arrntv::
+`arrntv`::
NamedList is represented as an array of Name Type Value JSON objects.
+
With input of `NamedList("a"=1, "bar"="foo", null=3, null=null)`, the output would be `[{"name":"a","type":"int","value":1}, {"name":"bar","type":"str","value":"foo"}, {"name":null,"type":"int","value":3}, {"name":null,"type":"null","value":null}]`.
@@ -138,29 +135,26 @@ Note that the XSLT Response Writer can be used to convert the XML produced by th
The behavior of the XML Response Writer can be driven by the following query parameters.
-=== The version Parameter
-
+`version`::
The `version` parameter determines the XML protocol used in the response. Clients are strongly encouraged to _always_ specify the protocol version, so as to ensure that the format of the response they receive does not change unexpectedly if the Solr server is upgraded and a new default format is introduced.
-
++
The only currently supported version value is `2.2`. The format of the `responseHeader` changed to use the same `<lst>` structure as the rest of the response.
-
++
The default value is the latest supported.
-=== stylesheet Parameter
-
+`stylesheet`::
The `stylesheet` parameter can be used to direct Solr to include a `<?xml-stylesheet type="text/xsl" href="..."?>` declaration in the XML response it returns.
-
++
The default behavior is not to return any stylesheet declaration at all.
-
++
[IMPORTANT]
====
Use of the `stylesheet` parameter is discouraged, as there is currently no way to specify external stylesheets, and no stylesheets are provided in the Solr distributions. This is a legacy parameter, which may be developed further in a future release.
====
-=== indent Parameter
-
+`indent`::
If the `indent` parameter is used, and has a non-blank value, then Solr will make some attempts at indenting its XML response to make it more readable by humans.
-
++
The default behavior is not to indent.
== XSLT Response Writer
diff --git a/solr/solr-ref-guide/src/stream-decorators.adoc b/solr/solr-ref-guide/src/stream-decorators.adoc
index 4db4a8278c9..2afb52421ab 100644
--- a/solr/solr-ref-guide/src/stream-decorators.adoc
+++ b/solr/solr-ref-guide/src/stream-decorators.adoc
@@ -643,7 +643,7 @@ daemon(id="myDaemon",
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.
+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
@@ -676,9 +676,9 @@ The `having` expression wraps a stream and applies a boolean operation to each t
=== 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.
+* `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.
+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
diff --git a/solr/solr-ref-guide/src/stream-evaluators.adoc b/solr/solr-ref-guide/src/stream-evaluators.adoc
index 02b7111ffcb..35997109432 100644
--- a/solr/solr-ref-guide/src/stream-evaluators.adoc
+++ b/solr/solr-ref-guide/src/stream-evaluators.adoc
@@ -32,30 +32,6 @@ 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.
-
-== 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.
-
-[source,text]
-----
-analyze("hello world", analyzerField) // Analyze the raw text
-select(expr, analyze(textField, analyzerField) as outField) // Analyze a text field within a select expression. This will annotate the tuples with output of the analyzer
-cartesianProduct(expr, analyze(textField, analyzer) as outField) // Analyze a text field with a cartesianProduct expression. This will stream each token emitted by the analyzer in its own tuple.
-----
-
-
== 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.
@@ -76,6 +52,23 @@ 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.
@@ -101,134 +94,126 @@ add(fieldA,div(fieldA,fieldB)) // value of fieldA + (value of fieldA / value of
add(fieldA,if(gt(fieldA,fieldB),fieldA,fieldB)) // if fieldA > fieldB then fieldA + fieldA, else fieldA + fieldB
----
-== div
+== analyze
-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.
+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.
-=== div Parameters
+=== analyze Parameters
-* `Field Name | Raw Number | Number Evaluator`
-* `Field Name | Raw Number | Number Evaluator`
+* `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.
-=== div Syntax
+=== analyze 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.
+The expressions below show the various ways in which you can use the `analyze` evaluator.
-[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)
-----
+* 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)`
-== log
+== and
-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.
+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.
-=== log Parameters
+=== and Parameters
-* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `......`
+* `Field Name | Raw Boolean | Boolean Evaluator`
-=== log Syntax
+=== and 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.
+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]
----
-log(100)
-log(add(fieldA,fieldB))
-log(fieldA)
+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)
----
-== 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.
+== anova
-=== mult Parameters
+The `anova` function calculates the https://en.wikipedia.org/wiki/Analysis_of_variance[analysis of variance] for two or more numeric arrays.
-* `Field Name | Raw Number | Number Evaluator`
-* `Field Name | Raw Number | Number Evaluator`
-* `......`
-* `Field Name | Raw Number | Number Evaluator`
+=== anova Parameters
-=== mult Syntax
+//TODO 7.1 - fill in details of Parameters
+* `numeric array` ... (two or more)
-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.
+=== anova Syntax
[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
-----
+anova(numericArray1, numericArray2) // calculates ANOVA for two numeric arrays
+anova(numericArray1, numericArray2, numericArray2) // calculates ANOVA for three numeric arrays
-== sub
+== array
-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.
+The `array` function returns an array of numerics or other objects including other arrays.
-=== sub Parameters
+=== array Parameters
-* `Field Name | Raw Number | Number Evaluator`
-* `Field Name | Raw Number | Number Evaluator`
-* `......`
-* `Field Name | Raw Number | Number Evaluator`
+//TODO 7.1 - fill in details of Parameters
+* `numeric` | `array` ...
-=== sub Syntax
+=== array 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]
+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]
----
-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
+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
----
-== pow
-The `pow` function returns the value of its first parameter raised to the power of its second parameter.
+== atan
-=== pow Parameters
+The `atan` function returns the trigonometric arctangent of a number.
-* `Field Name | Raw Number | Number Evaluator`: Parameter 1
-* `Field Name | Raw Number | Number Evaluator`: Parameter 2
+=== atan Parameters
-=== pow Syntax
+* `Field Name | Raw Number | Number Evaluator`: The value to return the arctangent of.
-The expressions below show the various ways in which you can use the `pow` evaluator.
+=== atan Syntax
[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.
+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
----
-== mod
-The `mod` function returns the remainder (modulo) of the first parameter divided by the second parameter.
+== cbrt
-=== mod Parameters
+The `cbrt` function returns the trigonometric cube root of a number.
-* `Field Name | Raw Number | Number Evaluator`: Parameter 1
-* `Field Name | Raw Number | Number Evaluator`: Parameter 2
+=== cbrt Parameters
-=== mod Syntax
+* `Field Name | Raw Number | Number Evaluator`: The value to return the cube root of.
-The expressions below show the various ways in which you can use the `mod` evaluator.
+=== cbrt Syntax
[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.
+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
@@ -249,78 +234,89 @@ 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.
----
-== floor
-The `floor` function rounds a decimal value to the next lowest whole number.
+== col
-=== floor Parameters
+The `col` function returns a numeric array from a list of Tuples. The `col`
+function is used to create numeric arrays from stream sources.
-* `Field Name | Raw Number | Number Evaluator`: The decimal to round down.
+=== col Parameters
-=== floor Syntax
+//TODO 7.1 - fill in details of Parameters
+* `list of Tuples`
+* `field name`: The field to create the array from.
-The expressions below show the various ways in which you can use the `floor` evaluator.
+
+=== col Syntax
[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.
-----
+col(tupleList, fieldName)
+== conv
-== sin
-The `sin` function returns the trigonometirc sine of a number.
+The `conv` function returns the https://en.wikipedia.org/wiki/Convolution[convolution] of two numeric arrays.
-=== sin Parameters
+=== conv Parameters
-* `Field Name | Raw Number | Number Evaluator`: The value to return the sine of.
+* `numeric array`
+* `numeric array`
-=== sin Syntax
+=== conv 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
-----
+conv(numericArray1, numericArray2)
+== copyOf
-== asin
-The `asin` function returns the trigonometirc arcsine of a number.
+The `copyOf` function creates a copy of a numeric array.
-=== asin Parameters
+=== copyOf Parameters
-* `Field Name | Raw Number | Number Evaluator`: The value to return the arcsine of.
+//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.
-=== asin Syntax
+=== copyOf 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
-----
+copyOf(numericArray, length)
+== copyOfRange
-== hsin
-The `hsin` function returns the trigonometirc hyperbolic sine of a number.
+The `copyOfRange` function creates a copy of a range of a numeric array.
-=== hsin Parameters
+=== copyOfRange Parameters
-* `Field Name | Raw Number | Number Evaluator`: The value to return the hyperbolic sine of.
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `start index`
+* `end index`
-=== hsin Syntax
+=== copyOfRange Syntax
[source,text]
-----
-hsin(100.4) // returns the hsine of 100.4
-hsine(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
-----
+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 trigonometirc cosine of a number.
+The `cos` function returns the trigonometric cosine of a number.
=== cos Parameters
@@ -335,113 +331,89 @@ 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
----
-== acos
+== cov
-The `acos` function returns the trigonometirc arccosine of a number.
+The `cov` function returns the covariance of two numeric arrays.
-=== acos Parameters
+=== cov Parameters
-* `Field Name | Raw Number | Number Evaluator`: The value to return the arccosine of.
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
+* `numeric array`
-=== acos Syntax
+=== cov 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
-----
+cov(numericArray, numericArray)
-== atan
+== describe
-The `atan` function returns the trigonometirc arctangent of a number.
+The `describe` function returns a tuple containing the descriptive statistics for an array.
-=== atan Parameters
+=== describe Parameters
-* `Field Name | Raw Number | Number Evaluator`: The value to return the arctangent of.
+* `numeric array`
-=== atan Syntax
+=== describe 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
-----
+describe(numericArray)
-== round
+== distance
-The `round` function returns the closest whole number to the argument
+The `distance` function calculates the Euclidian distance of two numeric arrays.
-=== round Parameters
+=== distance Parameters
-* `Field Name | Raw Number | Number Evaluator`: The value to return the square root of.
+* `numeric array`
+* `numeric array`
-=== round Syntax
+=== distance 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
-----
-
-== sqrt
-
-The `sqrt` function returns the trigonometirc square root of a number.
-
-=== sqrt Parameters
-
-* `Field Name | Raw Number | Number Evaluator`: The value to return the square root of.
-
-=== sqrt Syntax
+distance(numericArray1, numuericArray2))
-[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
-----
+== div
-== cbrt
+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.
-The `cbrt` function returns the trigonometirc cube root of a number.
+=== div Parameters
-=== cbrt Parameters
+* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Number | Number Evaluator`
-* `Field Name | Raw Number | Number Evaluator`: The value to return the cube root of.
+=== div Syntax
-=== cbrt 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]
----
-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
+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
-== 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.
+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.
-=== and Parameters
+=== eor Parameters
* `Field Name | Raw Boolean | Boolean Evaluator`
* `Field Name | Raw Boolean | Boolean Evaluator`
* `......`
* `Field Name | Raw Boolean | Boolean Evaluator`
-=== and Syntax
+=== eor 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.
+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]
----
-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)
+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
@@ -467,26 +439,57 @@ eq(fieldA,val(foo)) fieldA == "foo"
eq(add(fieldA,fieldB),6) // fieldA + fieldB == 6
----
-== eor
+== finddelay
-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.
+The `finddelay` function performs a cross-correlation between two numeric arrays and returns the delay.
-=== eor Parameters
+=== finddelay Parameters
-* `Field Name | Raw Boolean | Boolean Evaluator`
-* `Field Name | Raw Boolean | Boolean Evaluator`
-* `......`
-* `Field Name | Raw Boolean | Boolean Evaluator`
+* `numeric array`
+* `numeric array`
-=== eor Syntax
+=== finddelay 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]
+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]
----
-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
+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
@@ -510,25 +513,37 @@ gteq(fieldA,val(foo)) fieldA >= "foo"
gteq(add(fieldA,fieldB),6) // fieldA + fieldB >= 6
----
-== gt
+== hist
-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.
+The `hist` function creates a histogram from a numeric array. The hist function is designed
+to work with continuous variables.
-=== gt Parameters
+=== hist Parameters
-* `Field Name | Raw Value | Evaluator`
-* `Field Name | Raw Value | Evaluator`
+//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.
-=== gt Syntax
+=== hist Sytnax
-The expressions below show the various ways in which you can use the `gt` evaluator.
+[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]
----
-gt(1,2) // 1 > 2
-gt(1,fieldA) // 1 > fieldA
-gt(fieldA,val(foo)) // fieldA > "foo"
-gt(add(fieldA,fieldB),6) // fieldA + fieldB > 6
+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
@@ -552,25 +567,37 @@ 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
----
-== lteq
+== length
-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.
+The `length` function returns the length of a numeric array.
-=== lteq Parameters
+=== length Parameters
-* `Field Name | Raw Value | Evaluator`
-* `Field Name | Raw Value | Evaluator`
+//TODO 7.1 - fill in details of Parameters
+* `numeric array`
-=== lteq Syntax
+=== length Syntax
-The expressions below show the various ways in which you can use the `lteq` evaluator.
+[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]
----
-lteq(1,2) // 1 <= 2
-lteq(1,fieldA) // 1 <= fieldA
-lteq(fieldA,val(foo)) fieldA <= "foo"
-lteq(add(fieldA,fieldB),6) // fieldA + fieldB <= 6
+log(100)
+log(add(fieldA,fieldB))
+log(fieldA)
----
== lt
@@ -594,437 +621,346 @@ lt(fieldA,val(foo)) fieldA < "foo"
lt(add(fieldA,fieldB),6) // fieldA + fieldB < 6
----
-== not
+== lteq
-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.
+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.
-=== not Parameters
+=== lteq Parameters
-* `Field Name | Raw Boolean | Boolean Evaluator`
+* `Field Name | Raw Value | Evaluator`
+* `Field Name | Raw Value | Evaluator`
-=== not Syntax
+=== lteq Syntax
-The expressions below show the various ways in which you can use the `not` evaluator. Only one parameter is allowed.
+The expressions below show the various ways in which you can use the `lteq` evaluator.
[source,text]
----
-not(true) // false
-not(fieldA) // true if fieldA is false else false
-not(eq(fieldA,fieldB)) // true if fieldA != fieldB
+lteq(1,2) // 1 <= 2
+lteq(1,fieldA) // 1 <= fieldA
+lteq(fieldA,val(foo)) fieldA <= "foo"
+lteq(add(fieldA,fieldB),6) // fieldA + fieldB <= 6
----
-== 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.
+== mod
+The `mod` function returns the remainder (modulo) of the first parameter divided by the second parameter.
-=== or Parameters
+=== mod Parameters
-* `Field Name | Raw Boolean | Boolean Evaluator`
-* `Field Name | Raw Boolean | Boolean Evaluator`
-* `......`
-* `Field Name | Raw Boolean | Boolean Evaluator`
+* `Field Name | Raw Number | Number Evaluator`: Parameter 1
+* `Field Name | Raw Number | Number Evaluator`: Parameter 2
-=== or Syntax
+=== mod 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.
+The expressions below show the various ways in which you can use the `mod` evaluator.
[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)
-----
-
-== 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"
+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 moving average over an array of numbers.
-(https://en.wikipedia.org/wiki/Moving_average)
-
+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`
-
-=== movingAvg Returns
-
-A numeric array with the moving average. The array returned will be smaller then the
-orignal array by the window size.
+* `window size`: The array returned will be smaller than this value.
=== movingAvg Syntax
+[source,text]
movingAverage(numericArray, 30)
-== anova
-
-The `anova` function calculates the analysis of variance for two or more numeric arrays.
-
-(https://en.wikipedia.org/wiki/Analysis_of_variance)
-
-=== anova Parameters
-
-* `numeric array` ... (two or more)
-
-=== anova Returns
-
-A tuple with the results of ANOVA
-
-=== anova Syntax
-
-anova(numericArray1, numericArray2) // calculats ANOVA for two numeric arrays
-anova(numericArray1, numericArray2, numericArray2) // calculats ANOVA for three numeric arrays
-
-== hist
-
-The `hist` function creates a histogram from a numeric array. The hist function is designed
-to work with continuous variables.
-
-=== hist Parameters
-
-* `numeric array`
-* `bins` (The number of bins in the histogram)
-
-=== hist Returns
-
-A List of containing a tuple for each bin the the histogram. Each tuple contains
-summary statistics for the observations that were within the bin.
-
-=== hist Sytnax
-
-hist(numericArray, bins)
-
-== array
-
-The array function returns an array of numerics or other objects including other arrays.
-
-=== array Parameters
-
-* `numeric` | `array` ...
-
-=== array Returns
-
-array
-
-=== array Syntax
-
-array(1, 2, 3) // Array of numerics
-
-array(array(1,2,3), array(4,5,6)) // Array of arrays
-
-== sequence
-
-The `sequence` function returns an array of numbers based on its parameters.
-
-=== sequence Parameters
-
-* `length`
-* `start`
-* `stride`
-
-=== sequence Returns
-
-numeric array
-
-=== sequence Syntax
-
-sequence(100, 0, 1) // Returns a sequence of length 100, starting from 0 with a stride of 1.
-
-== finddelay
-
-The `finddelay` function performs a cross-correlation between two numeric arrays and returns the delay.
-
-=== finddelay Parameters
-
-* `numeric array`
-* `numeric array`
-
-=== finddelay Returns
-
-Integer delay
-
-=== finddelay Syntax
-
-finddelay(numericArray1, numericArray2)
-
-== describe
-
-The `describe` function returns a tuple containing the desciptive statistics for an array.
+== mult
-=== describe Parameters
+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.
-* `numeric array`
+=== mult Parameters
-=== describe Returns
+* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Number | Number Evaluator`
+* `......`
+* `Field Name | Raw Number | Number Evaluator`
-Tuple containing descriptive statistics
+=== mult Syntax
-=== describe 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.
-describe(numericArray)
+[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
+----
-== copyOfRange
+== normalize
-The `copyOfRange` function creates a copy of a range of a numeric array.
+The `normalize` function normalizes a numeric array so that values within the array
+have a mean of 0 and standard deviation of 1.
-=== copyOfRange Parameters
+=== normalize Parameters
* `numeric array`
-* `start index`
-* `end index`
-=== copyOfRange Returns
+=== normalize Syntax
-A copy of an arrar starting from the start index inclusive and ending at the end index
-exclusive.
+[source,text]
+normalize(numericArray)
-=== copyOfRange Syntax
+== not
-copyOfRange(numericArray, startIndex, endIndex)
+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.
-== copyOf
+=== not Parameters
-The `copyOf` function creates a copy of a numeric array.
+* `Field Name | Raw Boolean | Boolean Evaluator`
-=== copyOf Parameters
+=== not Syntax
-* `numeric array`
-* `length`
+The expressions below show the various ways in which you can use the `not` evaluator. Only one parameter is allowed.
-=== copyOf Returns
+[source,text]
+----
+not(true) // false
+not(fieldA) // true if fieldA is false else false
+not(eq(fieldA,fieldB)) // true if fieldA != fieldB
+----
-A copy of the numeric array starting from zero of size of the length parameter. The returned
- array will be right padded with zeros if the length parameter exceeds the size of the
- original array.
+== or
-=== copyOf Syntax
+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.
-copyOf(numericArray, length)
+=== or Parameters
-== distance
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `Field Name | Raw Boolean | Boolean Evaluator`
+* `......`
+* `Field Name | Raw Boolean | Boolean Evaluator`
-The `distance` function calculates the Euclidian distance of two numeric arrays.
+=== or Syntax
-=== distance Parameters
+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.
-* `numeric array`
-* `numeric array`
+[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)
+----
-=== distance Returns
+== predict
-number
+The `predict` function predicts the value of an dependent variable based on
+the output of the regress function.
-=== distance Syntax
+=== predict Parameters
-distance(numericArray1, numuericArray2))
+//TODO 7.1 - fill in details of Parameters
+* `regress output`
+* `numeric predictor`
-== scale
+=== predict Syntax
-The `scale` function multiplies all the elements of an array by a number.
+[source,text]
+predict(regressOutput, predictor)
-=== scale Parameters
+== pow
+The `pow` function returns the value of its first parameter raised to the power of its second parameter.
-* `number`
-* `numeric array`
+=== pow Parameters
-=== scale Returns
+* `Field Name | Raw Number | Number Evaluator`: Parameter 1
+* `Field Name | Raw Number | Number Evaluator`: Parameter 2
-A numeric array with the scaled values
+=== pow Syntax
-=== scale Syntax
+The expressions below show the various ways in which you can use the `pow` evaluator.
-scale(number, numericArray)
+[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 transformaion* on a numeric array.
+The `rank` performs a rank transformation on a numeric array.
=== rank Parameters
+//TODO 7.1 - fill in details of Parameters
* `numeric array`
-
-=== rank Returns
-
-numeric array with rank transformed values
-
=== rank Syntax
+[source,text]
rank(numericArray)
-== length
-
-The `length` function returns the length of a numeric array.
-
-=== length Parameters
-
-* `numeric array`
-
-=== length Returns
-
-integer
-
-=== length Syntax
-
-length(numericArray)
-
-== rev
-
-The `rev` function reverses the order of a numeric array.
+== raw
-=== rev Parameters
+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.
-* `numeric array`
+=== raw Parameters
-=== rev Returns
+* `Raw Value`
-A copy of a numeric array with its elements reveresed.
+=== raw Syntax
-=== rev 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.
-rev(numericArray)
+[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 Returns
-
-A regression result tuple which holds the regression results. The regression
-result tuple is also used by the predict function.
-
=== regress Syntax
+[source,text]
regress(numericArray1, numericArray2)
+== rev
-== predict
-
-The `predict` function predicts the value of an dependent variable based on
-the output of the regress function.
-
-=== predict Parameters
-
-* `regress output`
-* `numeric predictor`
-
-=== predict Returns
-
-The predicted value
+The `rev` function reverses the order of a numeric array.
-=== predict Syntax
+=== rev Parameters
-predict(regressOutput, predictor)
+* `numeric array`
-== col
+=== rev Syntax
-The `col` function returns a numeric array from a list of Tuples. The col
-function is used to create numeric arrays from stream sources.
+[source,text]
+rev(numericArray)
-=== col Parameters
+== round
-* `list of Tuples`
-* `field name`
+The `round` function returns the closest whole number to the argument
-=== col Returns
+=== round Parameters
-A numeric array from a list of tuples. The field name parameter specifies which field
-to create the array from.
+* `Field Name | Raw Number | Number Evaluator`: The value to return the square root of.
-=== col Syntax
+=== round Syntax
-col(tupleList, fieldName)
+[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
+----
-== cov
+== scale
-The `cov` function returns the covariance of two numeric arrays.
+The `scale` function multiplies all the elements of an array by a number.
-=== cov Parameters
+=== scale Parameters
-* `numeric array`
+//TODO 7.1 - fill in details of Parameters
+* `number`
* `numeric array`
-=== cov Returns
-
-Number
-
-=== cov Syntax
+=== scale Syntax
-cov(numericArray, numericArray)
+[source,text]
+scale(number, numericArray)
-== corr
+== sequence
-The `corr` function returns the Pearson Product Moment Correlation of two numeric arrays.
+The `sequence` function returns an array of numbers based on its parameters.
-=== corr Parameters
+=== sequence Parameters
-* `numeric array`
-* `numeric array`
+//TODO 7.1 - fill in details of Parameters
+* `length`
+* `start`
+* `stride`
-=== corr Returns
+=== sequence Syntax
-double between -1 and 1
+[source,text]
+sequence(100, 0, 1) // Returns a sequence of length 100, starting from 0 with a stride of 1.
-=== corr Synax
+== sin
+The `sin` function returns the trigonometric sine of a number.
-corr(numericArray1, numericArray2)
+=== sin Parameters
-== conv
+* `Field Name | Raw Number | Number Evaluator`: The value to return the sine of.
-The `conv` function returns the convolution (https://en.wikipedia.org/wiki/Convolution) of two numeric arrays.
+=== sin Syntax
-=== conv Parameters
+[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
+----
-* `numeric array`
-* `numeric array`
+== sqrt
-=== conv Returns
+The `sqrt` function returns the trigonometric square root of a number.
-A numeric array with the convolution of the two array parameters.
+=== sqrt Parameters
-=== conv Syntax
+* `Field Name | Raw Number | Number Evaluator`: The value to return the square root of.
-conv(numericArray1, numericArray2)
+=== sqrt Syntax
-== normalize
+[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
+----
-The `normalize` function normalizes a numeric array so that values within the array
-have a mean of 0 and standard deviation of 1.
+== sub
-=== normalize Parameters
+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.
-* `numeric array`
+=== sub Parameters
-=== normalize Returns
+* `Field Name | Raw Number | Number Evaluator`
+* `Field Name | Raw Number | Number Evaluator`
+* `......`
+* `Field Name | Raw Number | Number Evaluator`
-A numeric array with normalized values.
+=== sub Syntax
-=== normalize 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.
-normalize(numericArray)
+[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
+----
diff --git a/solr/solr-ref-guide/src/stream-sources.adoc b/solr/solr-ref-guide/src/stream-sources.adoc
index 19a2e558346..2b59edf9be8 100644
--- a/solr/solr-ref-guide/src/stream-sources.adoc
+++ b/solr/solr-ref-guide/src/stream-sources.adoc
@@ -536,5 +536,3 @@ the tuple stream from the Stream Expression into a list of Tuples.
tuple(a=add(1,1),
b=search(collection1, q="cat:a", fl="a, b, c", sort="a desc"))
----
-
-
diff --git a/solr/solr-ref-guide/src/the-query-elevation-component.adoc b/solr/solr-ref-guide/src/the-query-elevation-component.adoc
index 3a44975f0bf..4edfbac3f63 100644
--- a/solr/solr-ref-guide/src/the-query-elevation-component.adoc
+++ b/solr/solr-ref-guide/src/the-query-elevation-component.adoc
@@ -101,31 +101,37 @@ If documents to be elevated are not defined in the `elevate.xml` file, they shou
For debugging it may be useful to see results with and without the elevated docs. To hide results, use `enableElevation=false`:
-`\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=true`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=true
-`\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=false`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=false
=== The forceElevation Parameter
You can force elevation during runtime by adding `forceElevation=true` to the query URL:
-`\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=true&forceElevation=true`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&enableElevation=true&forceElevation=true
=== The exclusive Parameter
You can force Solr to return only the results specified in the elevation file by adding `exclusive=true` to the URL:
-`\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&exclusive=true`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&debugQuery=true&exclusive=true
=== Document Transformers and the markExcludes Parameter
The `[elevated]` <<transforming-result-documents.adoc#transforming-result-documents,Document Transformer>> can be used to annotate each document with information about whether or not it was elevated:
-`\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&fl=id,[elevated]`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&fl=id,[elevated]
Likewise, it can be helpful when troubleshooting to see all matching documents – including documents that the elevation configuration would normally exclude. This is possible by using the `markExcludes=true` parameter, and then using the `[excluded]` transformer:
-`\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&markExcludes=true&fl=id,[elevated],[excluded]`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&markExcludes=true&fl=id,[elevated],[excluded]
=== The elevateIds and excludeIds Parameters
@@ -133,13 +139,15 @@ When the elevation component is in use, the pre-configured list of elevations fo
For example, in the request below documents 3007WFP and 9885A004 will be elevated, and document IW-02 will be excluded -- regardless of what elevations or exclusions are configured for the query "cable" in elevate.xml:
-`\http://localhost:8983/solr/techproducts/elevate?q=cable&df=text&excludeIds=IW-02&elevateIds=3007WFP,9885A004`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=cable&df=text&excludeIds=IW-02&elevateIds=3007WFP,9885A004
If either one of these parameters is specified at request time, the the entire elevation configuration for the query is ignored.
For example, in the request below documents IW-02 and F8V7067-APL-KIT will be elevated, and no documents will be excluded – regardless of what elevations or exclusions are configured for the query "ipod" in elevate.xml:
-`\http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&elevateIds=IW-02,F8V7067-APL-KIT`
+[source,text]
+http://localhost:8983/solr/techproducts/elevate?q=ipod&df=text&elevateIds=IW-02,F8V7067-APL-KIT
=== The fq Parameter with Elevation
diff --git a/solr/solr-ref-guide/src/the-stats-component.adoc b/solr/solr-ref-guide/src/the-stats-component.adoc
index b3545055cf0..58add0adec6 100644
--- a/solr/solr-ref-guide/src/the-stats-component.adoc
+++ b/solr/solr-ref-guide/src/the-stats-component.adoc
@@ -44,7 +44,10 @@ Specifies a field for which statistics should be generated. This parameter may b
The query below demonstrates computing stats against two different fields numeric fields, as well as stats over the results of a `termfreq()` function call using the `text` field:
-`\http://localhost:8983/solr/techproducts/select?q=*:*&stats=true&stats.field={!func}termfreq('text','memory')&stats.field=price&stats.field=popularity&rows=0&indent=true`
+[source,text]
+----
+http://localhost:8983/solr/techproducts/select?q=*:*&wt=xml&stats=true&stats.field={!func}termfreq('text','memory')&stats.field=price&stats.field=popularity&rows=0&indent=true
+----
[source,xml]
----
@@ -159,7 +162,8 @@ Additional "Expert" local params are supported in some cases for affecting the b
Here we compute some statistics for the price field. The min, max, mean, 90th, and 99th percentile price values are computed against all products that are in stock (`q=*:*` and `fq=inStock:true`), and independently all of the default statistics are computed against all products regardless of whether they are in stock or not (by excluding that filter).
-`\http://localhost:8983/solr/techproducts/select?q=*:*&fq={!tag=stock_check}inStock:true&stats=true&stats.field={!ex=stock_check+key=instock_prices+min=true+max=true+mean=true+percentiles='90,99'}price&stats.field={!key=all_prices}price&rows=0&indent=true`
+[source,text]
+http://localhost:8983/solr/techproducts/select?q=*:*&fq={!tag=stock_check}inStock:true&stats=true&stats.field={!ex=stock_check+key=instock_prices+min=true+max=true+mean=true+percentiles='90,99'}price&stats.field={!key=all_prices}price&rows=0&indent=true
[source,xml]
----
diff --git a/solr/solr-ref-guide/src/the-term-vector-component.adoc b/solr/solr-ref-guide/src/the-term-vector-component.adoc
index 2e9c1dd837d..0a414d2a750 100644
--- a/solr/solr-ref-guide/src/the-term-vector-component.adoc
+++ b/solr/solr-ref-guide/src/the-term-vector-component.adoc
@@ -70,7 +70,8 @@ Once your handler is defined, you may use in conjunction with any schema (that h
The example below shows an invocation of this component using the above configuration:
-`\http://localhost:8983/solr/techproducts/tvrh?q=*:*&start=0&rows=10&fl=id,includes`
+[source,text]
+http://localhost:8983/solr/techproducts/tvrh?q=*:*&start=0&rows=10&fl=id,includes&wt=xml
[source,xml]
----
diff --git a/solr/solr-ref-guide/src/the-terms-component.adoc b/solr/solr-ref-guide/src/the-terms-component.adoc
index 9f10fb633c9..b1f44e4dc61 100644
--- a/solr/solr-ref-guide/src/the-terms-component.adoc
+++ b/solr/solr-ref-guide/src/the-terms-component.adoc
@@ -161,7 +161,10 @@ All of the following sample queries work with Solr's "`bin/solr -e techproducts`
=== Get Top 10 Terms
-This query requests the first ten terms in the name field: `\http://localhost:8983/solr/techproducts/terms?terms.fl=name`
+This query requests the first ten terms in the name field:
+
+[source,text]
+http://localhost:8983/solr/techproducts/terms?terms.fl=name&wt=xml
Results:
@@ -191,7 +194,10 @@ Results:
=== Get First 10 Terms Starting with Letter 'a'
-This query requests the first ten terms in the name field, in index order (instead of the top 10 results by document count): `\http://localhost:8983/solr/techproducts/terms?terms.fl=name&terms.lower=a&terms.sort=index`
+This query requests the first ten terms in the name field, in index order (instead of the top 10 results by document count):
+
+[source,text]
+http://localhost:8983/solr/techproducts/terms?terms.fl=name&terms.lower=a&terms.sort=index&wt=xml
Results:
@@ -240,7 +246,8 @@ Results:
If the <<suggester.adoc#suggester,Suggester>> doesn't suit your needs, you can use the Terms component in Solr to build a similar feature for your own search application. Simply submit a query specifying whatever characters the user has typed so far as a prefix. For example, if the user has typed "at", the search engine's interface would submit the following query:
-`\http://localhost:8983/solr/techproducts/terms?terms.fl=name&terms.prefix=at`
+[source,text]
+http://localhost:8983/solr/techproducts/terms?terms.fl=name&terms.prefix=at&wt=xml
Result:
@@ -260,7 +267,10 @@ Result:
</response>
----
-You can use the parameter `omitHeader=true` to omit the response header from the query response, like in this example, which also returns the response in JSON format: `\http://localhost:8983/solr/techproducts/terms?terms.fl=name&terms.prefix=at&omitHeader=true`
+You can use the parameter `omitHeader=true` to omit the response header from the query response, like in this example, which also returns the response in JSON format:
+
+[source,text]
+http://localhost:8983/solr/techproducts/terms?terms.fl=name&terms.prefix=at&omitHeader=true
Result:
diff --git a/solr/solr-ref-guide/src/working-with-dates.adoc b/solr/solr-ref-guide/src/working-with-dates.adoc
index 811364fa262..f99d0e7a58b 100644
--- a/solr/solr-ref-guide/src/working-with-dates.adoc
+++ b/solr/solr-ref-guide/src/working-with-dates.adoc
@@ -154,13 +154,21 @@ http://localhost:8983/solr/my_collection/select?q=*:*&facet.range=my_date_field&
== More DateRangeField Details
-`DateRangeField` is almost a drop-in replacement for places where `DatePointField` is used. The only difference is that Solr's XML or SolrJ response formats will expose the stored data as a String instead of a Date. The underlying index data for this field will be a bit larger. Queries that align to units of time a second on up should be faster than TrieDateField, especially if it's in UTC. But the main point of DateRangeField as its name suggests is to allow indexing date ranges. To do that, simply supply strings in the format shown above. It also supports specifying 3 different relational predicates between the indexed data, and the query range: `Intersects` (default), `Contains`, `Within`. You can specify the predicate by querying using the `op` local-params parameter like so:
+`DateRangeField` is almost a drop-in replacement for places where `DatePointField` is used. The only difference is that Solr's XML or SolrJ response formats will expose the stored data as a String instead of a Date. The underlying index data for this field will be a bit larger. Queries that align to units of time a second on up should be faster than TrieDateField, especially if it's in UTC.
+
+The main point of `DateRangeField`, as its name suggests, is to allow indexing date ranges. To do that, simply supply strings in the format shown above. It also supports specifying 3 different relational predicates between the indexed data, and the query range:
+
+* `Intersects` (default)
+* `Contains`
+* `Within`
+
+You can specify the predicate by querying using the `op` local-params parameter like so:
[source,text]
----
fq={!field f=dateRange op=Contains}[2013 TO 2018]
----
-Unlike most/all local-params, `op` is actually _not_ defined by any query parser (`field`), it is defined by the field type – `DateRangeField`. In that example, it would find documents with indexed ranges that _contain_ (or equals) the range 2013 thru 2018. Multi-valued overlapping indexed ranges in a document are effectively coalesced.
+Unlike most local parameters, `op` is actually _not_ defined by any query parser (`field`), it is defined by the field type, in this case `DateRangeField`. In the above example, it would find documents with indexed ranges that _contain_ (or equals) the range 2013 thru 2018. Multi-valued overlapping indexed ranges in a document are effectively coalesced.
For a DateRangeField example use-case, see http://wiki.apache.org/solr/DateRangeField[see Solr's community wiki].