You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/09/17 10:09:04 UTC

[19/44] lucene-solr:jira/solr-12709: SOLR-12701: format/style consistency fixes for math expression docs; CSS change to make bold monospace appear properly

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a619038e/solr/solr-ref-guide/src/term-vectors.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/term-vectors.adoc b/solr/solr-ref-guide/src/term-vectors.adoc
index 32c4bfa..2510099 100644
--- a/solr/solr-ref-guide/src/term-vectors.adoc
+++ b/solr/solr-ref-guide/src/term-vectors.adoc
@@ -16,9 +16,9 @@
 // specific language governing permissions and limitations
 // under the License.
 
-TF-IDF term vectors are often used to represent text documents when performing text mining
-and machine learning operations. This section of the user guide describes how to
-use math expressions to perform text analysis and create TF-IDF term vectors.
+Term frequency-inverse document frequency (TF-IDF) term vectors are often used to
+represent text documents when performing text mining and machine learning operations. The math expressions
+library can be used to perform text analysis and create TF-IDF term vectors.
 
 == Text Analysis
 
@@ -26,17 +26,16 @@ The `analyze` function applies a Solr analyzer to a text field and returns the t
 emitted by the analyzer in an array. Any analyzer chain that is attached to a field in Solr's
 schema can be used with the `analyze` function.
 
-In the example below, the text "hello world" is analyzed using the analyzer chain attached to the *subject* field in
-the schema. The *subject* field is defined as the field type *text_general* and the text is analyzed using the
-analysis chain configured for the *text_general* field type.
+In the example below, the text "hello world" is analyzed using the analyzer chain attached to the `subject` field in
+the schema. The `subject` field is defined as the field type `text_general` and the text is analyzed using the
+analysis chain configured for the `text_general` field type.
 
 [source,text]
 ----
 analyze("hello world", subject)
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -63,13 +62,12 @@ responds with:
 The `analyze` function can be used inside of a `select` function to annotate documents with the tokens
 generated by the analysis.
 
-The example below is performing a `search` in collection1. Each tuple returned by the `search`
-contains an *id* and *subject*. For each tuple, the
-`select` function is selecting the *id* field and calling the `analyze` function on the *subject* field.
-The analyzer chain specified by the *subject_bigram* field is configured to perform a bigram analysis.
+The example below performs a `search` in "collection1". Each tuple returned by the `search` function
+contains an `id` and `subject`. For each tuple, the
+`select` function selects the `id` field and calls the `analyze` function on the `subject` field.
+The analyzer chain specified by the `subject_bigram` field is configured to perform a bigram analysis.
 The tokens generated by the `analyze` function are added to each tuple in a field called `terms`.
 
-Notice in the output that an array of bigram terms have been added to the tuples.
 
 [source,text]
 ----
@@ -78,8 +76,7 @@ select(search(collection1, q="*:*", fl="id, subject", sort="id asc"),
        analyze(subject, subject_bigram) as terms)
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+Notice in the output that an array of bigram terms have been added to the tuples:
 
 [source,json]
 ----
@@ -111,42 +108,37 @@ responds with:
 
 == TF-IDF Term Vectors
 
-The `termVectors` function can be used to build *TF-IDF*
-term vectors from the terms generated by the `analyze` function.
-
-The `termVectors` function operates over a list of tuples that contain a field
-called *id* and a field called *terms*. Notice
-that this is the exact output structure of the *document annotation* example above.
-
-The `termVectors` function builds a *matrix* from the list of tuples. There is *row* in the
-matrix for each tuple in the list. There is a *column* in the matrix for each term in the *terms*
-field.
-
-The example below builds on the *document annotation* example.
-The list of tuples are stored in variable *a*. The `termVectors` function
-operates over variable *a* and builds a matrix with *2 rows* and *4 columns*.
+The `termVectors` function can be used to build TF-IDF term vectors from the terms generated by the `analyze` function.
 
-The `termVectors` function also sets the *row* and *column* labels of the term vectors matrix.
-The row labels are the document ids and the
-column labels are the terms.
+The `termVectors` function operates over a list of tuples that contain a field called `id` and a field called `terms`.
+Notice that this is the exact output structure of the document annotation example above.
 
-In the example below, the `getRowLabels` and `getColumnLabels` functions return
-the row and column labels which are then stored in variables *c* and *d*.
-The *echo* parameter is echoing variables *c* and *d*, so the output includes
-the row and column labels.
+The `termVectors` function builds a matrix from the list of tuples. There is row in the
+matrix for each tuple in the list. There is a column in the matrix for each term in the `terms` field.
 
 [source,text]
 ----
-let(echo="c, d",
-    a=select(search(collection3, q="*:*", fl="id, subject", sort="id asc"),
+let(echo="c, d", <1>
+    a=select(search(collection3, q="*:*", fl="id, subject", sort="id asc"), <2>
              id,
              analyze(subject, subject_bigram) as terms),
-    b=termVectors(a, minTermLength=4, minDocFreq=0, maxDocFreq=1),
-    c=getRowLabels(b),
+    b=termVectors(a, minTermLength=4, minDocFreq=0, maxDocFreq=1), <3>
+    c=getRowLabels(b), <4>
     d=getColumnLabels(b))
 ----
 
-When this expression is sent to the /stream handler it
+The example below builds on the document annotation example.
+
+<1> The `echo` parameter will echo variables *`c`* and *`d`*, so the output includes
+the row and column labels, which will be defined later in the expression.
+<2> The list of tuples are stored in variable *`a`*. The `termVectors` function
+operates over variable *`a`* and builds a matrix with 2 rows and 4 columns.
+<3> The `termVectors` function sets the row and column labels of the term vectors matrix as variable *`b`*.
+The row labels are the document ids and the column labels are the terms.
+<4> The `getRowLabels` and `getColumnLabels` functions return
+the row and column labels which are then stored in variables *`c`* and *`d`*.
+
+When this expression is sent to the `/stream` handler it
 responds with:
 
 [source,json]
@@ -188,7 +180,7 @@ let(a=select(search(collection3, q="*:*", fl="id, subject", sort="id asc"),
     b=termVectors(a, minTermLength=4, minDocFreq=0, maxDocFreq=1))
 ----
 
-When this expression is sent to the /stream handler it
+When this expression is sent to the `/stream` handler it
 responds with:
 
 [source,json]
@@ -230,8 +222,15 @@ the noisy terms helps keep the term vector matrix small enough to fit comfortabl
 
 There are four parameters designed to filter noisy terms from the term vector matrix:
 
-* *minTermLength*: The minimum term length required to include the term in the matrix.
-* *minDocFreq*: The minimum *percentage* (0 to 1) of documents the term must appear in to be included in the index.
-* *maxDocFreq*: The maximum *percentage* (0 to 1) of documents the term can appear in to be included in the index.
-* *exclude*: A comma delimited list of strings used to exclude terms. If a term contains any of the exclude strings that
+`minTermLength`::
+The minimum term length required to include the term in the matrix.
+
+minDocFreq::
+The minimum percentage, expressed as a number between 0 and 1, of documents the term must appear in to be included in the index.
+
+maxDocFreq::
+The maximum percentage, expressed as a number between 0 and 1, of documents the term can appear in to be included in the index.
+
+exclude::
+A comma delimited list of strings used to exclude terms. If a term contains any of the exclude strings that
 term will be excluded from the term vector.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a619038e/solr/solr-ref-guide/src/time-series.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/time-series.adoc b/solr/solr-ref-guide/src/time-series.adoc
index e765270..c68ee3c 100644
--- a/solr/solr-ref-guide/src/time-series.adoc
+++ b/solr/solr-ref-guide/src/time-series.adoc
@@ -38,7 +38,7 @@ timeseries(collection1,
            count(*))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -121,7 +121,7 @@ let(a=timeseries(collection1,
     b=col(a, count(*)))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -192,7 +192,7 @@ let(a=timeseries(collection1,
     c=movingAvg(b, 3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -242,7 +242,7 @@ let(a=timeseries(collection1, q=*:*,
     c=expMovingAvg(b, 3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -292,7 +292,7 @@ let(a=timeseries(collection1,
     c=movingMedian(b, 3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -353,7 +353,7 @@ let(a=timeseries(collection1,
     c=diff(b))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -403,7 +403,7 @@ let(a=array(1,2,5,2,1,2,5,2,1,2,5),
      b=diff(a, 4))
 ----
 
-Expression is sent to the /stream handler it responds with:
+Expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a619038e/solr/solr-ref-guide/src/variables.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/variables.adoc b/solr/solr-ref-guide/src/variables.adoc
index 99ac750..894a5ac 100644
--- a/solr/solr-ref-guide/src/variables.adoc
+++ b/solr/solr-ref-guide/src/variables.adoc
@@ -16,19 +16,17 @@
 // specific language governing permissions and limitations
 // under the License.
 
+
 == The Let Expression
 
 The `let` expression sets variables and returns
-the value of the last variable by default. The output of any streaming expression
-or math expression can be set to a variable.
+the value of the last variable by default. The output of any streaming expression or math expression can be set to a variable.
 
-Below is a simple example setting three variables *a*, *b*
-and *c*. Variables *a* and *b* are set to arrays. The variable *c* is set
+Below is a simple example setting three variables *`a`*, *`b`*
+and *`c`*. Variables *`a`* and *`b`* are set to arrays. The variable *`c`* is set
 to the output of the `ebeAdd` function which performs element-by-element
 addition of the two arrays.
 
-Notice that the last variable, *c*, is returned.
-
 [source,text]
 ----
 let(a=array(1, 2, 3),
@@ -36,8 +34,7 @@ let(a=array(1, 2, 3),
     c=ebeAdd(a, b))
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+In the response, notice that the last variable, *`c`*, is returned:
 
 [source,json]
 ----
@@ -62,7 +59,7 @@ responds with:
 
 == Echoing Variables
 
-All variables can be output by setting the *echo* variable to *true*.
+All variables can be output by setting the `echo` variable to `true`.
 
 [source,text]
 ----
@@ -72,7 +69,7 @@ let(echo=true,
     c=ebeAdd(a, b))
 ----
 
-When this expression is sent to the /stream handler it
+When this expression is sent to the `/stream` handler it
 responds with:
 
 [source,json]
@@ -106,8 +103,8 @@ responds with:
 }
 ----
 
-A specific set of variables can be echoed by providing a comma delimited
-list of variables to the echo parameter.
+A specific set of variables can be echoed by providing a comma delimited list of variables to the echo parameter.
+Because variables have been provided, the `true` value is assumed.
 
 [source,text]
 ----
@@ -117,8 +114,7 @@ let(echo="a,b",
     c=ebeAdd(a, b))
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -150,13 +146,13 @@ responds with:
 
 Variables can be cached in-memory on the Solr node where the math expression
 was run. A cached variable can then be used in future expressions. Any object
-that can be set to a variable, including data structures and mathematical models can
+that can be set to a variable, including data structures and mathematical models, can
 be cached in-memory for future use.
 
 The `putCache` function adds a variable to the cache.
 
-In the example below an array is cached in the *workspace* workspace1
-and bound to the *key* key1. The workspace allows different users to cache
+In the example below an array is cached in the `workspace` "workspace1"
+and bound to the `key` "key1". The workspace allows different users to cache
 objects in their own workspace. The `putCache` function returns
 the variable that was added to the cache.
 
@@ -168,8 +164,7 @@ let(a=array(1, 2, 3),
     d=putCache(workspace1, key1, c))
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -192,20 +187,16 @@ responds with:
 }
 ----
 
-The `getCache` function retrieves an object from the
-cache by its workspace and key.
-
-In the example below the `getCache` function retrieves
-the array the was cached above and assigns it to variable *a*.
+The `getCache` function retrieves an object from the cache by its workspace and key.
 
+In the example below the `getCache` function retrieves the array the was cached above and assigns it to variable *`a`*.
 
 [source,text]
 ----
 let(a=getCache(workspace1, key1))
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -228,18 +219,16 @@ responds with:
 }
 ----
 
-The `listCache` function can be used to list the workspaces or the
-keys in a specific workspace.
+The `listCache` function can be used to list the workspaces or the keys in a specific workspace.
 
-In the example below `listCache` returns all the workspaces in the cache
-as an array of strings.
+In the example below `listCache` returns all the workspaces in the cache as an array of strings.
 
 [source,text]
 ----
 let(a=listCache())
 ----
 
-When this expression is sent to the /stream handler it
+When this expression is sent to the `/stream` handler it
 responds with:
 
 [source,json]
@@ -264,14 +253,12 @@ responds with:
 
 In the example below all the keys in a specific workspace are listed:
 
-
 [source,text]
 ----
 let(a=listCache(workspace1))
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -296,17 +283,14 @@ The `removeCache` function can be used to remove a a key from a specific
 workspace. This `removeCache` function removes the key from the cache
 and returns the object that was removed.
 
-In the example below the array that was cached above is removed from the
-cache.
-
+In the example below the array that was cached above is removed from the cache.
 
 [source,text]
 ----
 let(a=removeCache(workspace1, key1))
 ----
 
-When this expression is sent to the /stream handler it
-responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a619038e/solr/solr-ref-guide/src/vector-math.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/vector-math.adoc b/solr/solr-ref-guide/src/vector-math.adoc
index 22d610f..e06008d 100644
--- a/solr/solr-ref-guide/src/vector-math.adoc
+++ b/solr/solr-ref-guide/src/vector-math.adoc
@@ -16,23 +16,20 @@
 // specific language governing permissions and limitations
 // under the License.
 
-This section of the user guide covers vector math and
-vector manipulation functions.
+This section covers vector math and vector manipulation functions.
 
 == Arrays
 
 Arrays can be created with the `array` function.
 
-For example the expression below creates a numeric array with
-three elements:
+For example, the expression below creates a numeric array with three elements:
 
 [source,text]
 ----
 array(1, 2, 3)
 ----
 
-When this expression is sent to the /stream handler it responds with
-a json array.
+When this expression is sent to the `/stream` handler it responds with a JSON array:
 
 [source,json]
 ----
@@ -66,7 +63,7 @@ For example, an array can be reversed with the `rev` function:
 rev(array(1, 2, 3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -89,15 +86,14 @@ When this expression is sent to the /stream handler it responds with:
 }
 ----
 
-Another example is the `length` function,
-which returns the length of an array:
+Another example is the `length` function, which returns the length of an array:
 
 [source,text]
 ----
 length(array(1, 2, 3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -124,7 +120,7 @@ copies elements of an array from a start and end range.
 copyOfRange(array(1,2,3,4,5,6), 1, 4)
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -149,21 +145,18 @@ When this expression is sent to the /stream handler it responds with:
 
 == Vector Summarizations and Norms
 
-There are a set of functions that perform
-summerizations and return norms of arrays. These functions
-operate over an array and return a single
-value. The following vector summarizations and norm functions are available:
+There are a set of functions that perform summarizations and return norms of arrays. These functions
+operate over an array and return a single value. The following vector summarizations and norm functions are available:
 `mult`, `add`, `sumSq`, `mean`, `l1norm`, `l2norm`, `linfnorm`.
 
-The example below is using the `mult` function,
-which multiples all the values of an array.
+The example below shows the `mult` function, which multiples all the values of an array.
 
 [source,text]
 ----
 mult(array(2,4,8))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -184,14 +177,14 @@ When this expression is sent to the /stream handler it responds with:
 
 The vector norm functions provide different formulas for calculating vector magnitude.
 
-The example below calculates the *l2norm* of an array.
+The example below calculates the `l2norm` of an array.
 
 [source,text]
 ----
 l2norm(array(2,4,8))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -212,12 +205,11 @@ When this expression is sent to the /stream handler it responds with:
 
 == Scalar Vector Math
 
-Scalar vector math functions add, subtract, multiple or divide a scalar value with every value in a vector.
+Scalar vector math functions add, subtract, multiply or divide a scalar value with every value in a vector.
 The following functions perform these operations: `scalarAdd`, `scalarSubtract`, `scalarMultiply`
 and `scalarDivide`.
 
-
-Below is an example of the `scalarMultiply` function, which multiplies the scalar value 3 with
+Below is an example of the `scalarMultiply` function, which multiplies the scalar value `3` with
 every value of an array.
 
 [source,text]
@@ -225,7 +217,7 @@ every value of an array.
 scalarMultiply(3, array(1,2,3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -251,7 +243,7 @@ When this expression is sent to the /stream handler it responds with:
 == Element-By-Element Vector Math
 
 Two vectors can be added, subtracted, multiplied and divided using element-by-element
-vector math functions. The following element-by-element vector math functions are:
+vector math functions. The available element-by-element vector math functions are:
 `ebeAdd`, `ebeSubtract`, `ebeMultiply`, `ebeDivide`.
 
 The expression below performs the element-by-element subtraction of two arrays.
@@ -261,7 +253,7 @@ The expression below performs the element-by-element subtraction of two arrays.
 ebeSubtract(array(10, 15, 20), array(1,2,3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -297,7 +289,7 @@ Below is an example of the `dotProduct` function:
 dotProduct(array(2,3,0,0,0,1), array(2,0,1,0,0,3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -323,7 +315,7 @@ Below is an example of the `cosineSimilarity` function:
 cosineSimilarity(array(2,3,0,0,0,1), array(2,0,1,0,0,3))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -340,4 +332,4 @@ When this expression is sent to the /stream handler it responds with:
     ]
   }
 }
-----
\ No newline at end of file
+----

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a619038e/solr/solr-ref-guide/src/vectorization.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/vectorization.adoc b/solr/solr-ref-guide/src/vectorization.adoc
index 2770320..5fdfadc 100644
--- a/solr/solr-ref-guide/src/vectorization.adoc
+++ b/solr/solr-ref-guide/src/vectorization.adoc
@@ -18,11 +18,10 @@
 
 This section of the user guide explores techniques
 for retrieving streams of data from Solr and vectorizing the
-*numeric* fields.
+numeric fields.
 
-The next chapter of the user guide covers
-Text Analysis and Term Vectors which describes how to
-vectorize *text* fields.
+See the section <<term-vectors.adoc#term-vectors,Text Analysis and Term Vectors>> which describes how to
+vectorize text fields.
 
 == Streams
 
@@ -32,42 +31,42 @@ to vectorize and analyze the results sets.
 
 Below are some of the key stream sources:
 
-* *random*: Random sampling is widely used in statistics, probability and machine learning.
+* *`random`*: Random sampling is widely used in statistics, probability and machine learning.
 The `random` function returns a random sample of search results that match a
 query. The random samples can be vectorized and operated on by math expressions and the results
 can be used to describe and make inferences about the entire population.
 
-* *timeseries*: The `timeseries`
+* *`timeseries`*: The `timeseries`
 expression provides fast distributed time series aggregations, which can be
 vectorized and analyzed with math expressions.
 
-* *knnSearch*: K-nearest neighbor is a core machine learning algorithm. The `knnSearch`
+* *`knnSearch`*: K-nearest neighbor is a core machine learning algorithm. The `knnSearch`
 function is a specialized knn algorithm optimized to find the k-nearest neighbors of a document in
 a distributed index. Once the nearest neighbors are retrieved they can be vectorized
 and operated on by machine learning and text mining algorithms.
 
-* *sql*: SQL is the primary query language used by data scientists. The `sql` function supports
+* *`sql`*: SQL is the primary query language used by data scientists. The `sql` function supports
 data retrieval using a subset of SQL which includes both full text search and
 fast distributed aggregations. The result sets can then be vectorized and operated
 on by math expressions.
 
-* *jdbc*: The `jdbc` function allows data from any JDBC compliant data source to be combined with
+* *`jdbc`*: The `jdbc` function allows data from any JDBC compliant data source to be combined with
 streams originating from Solr. Result sets from outside data sources can be vectorized and operated
 on by math expressions in the same manner as result sets originating from Solr.
 
-* *topic*: Messaging is an important foundational technology for large scale computing. The `topic`
+* *`topic`*: Messaging is an important foundational technology for large scale computing. The `topic`
 function provides publish/subscribe messaging capabilities by treating
 Solr Cloud as a distributed message queue. Topics are extremely powerful
 because they allow subscription by query. Topics can be use to support a broad set of
 use cases including bulk text mining operations and AI alerting.
 
-* *nodes*: Graph queries are frequently used by recommendation engines and are an important
+* *`nodes`*: Graph queries are frequently used by recommendation engines and are an important
 machine learning tool. The `nodes` function provides fast, distributed, breadth
 first graph traversal over documents in a Solr Cloud collection. The node sets collected
 by the `nodes` function can be operated on by statistical and machine learning expressions to
 gain more insight into the graph.
 
-* *search*: Ranked search results are a powerful tool for finding the most relevant
+* *`search`*: Ranked search results are a powerful tool for finding the most relevant
 documents from a large document corpus. The `search` expression
 returns the top N ranked search results that match any
 Solr query, including geo-spatial queries. The smaller set of relevant
@@ -79,7 +78,7 @@ text mining expressions to gather insights about the data set.
 The output of any streaming expression can be set to a variable.
 Below is a very simple example using the `random` function to fetch
 three random samples from collection1. The random samples are returned
-as *tuples*, which contain name/value pairs.
+as tuples which contain name/value pairs.
 
 
 [source,text]
@@ -87,7 +86,7 @@ as *tuples*, which contain name/value pairs.
 let(a=random(collection1, q="*:*", rows="3", fl="price_f"))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -116,10 +115,10 @@ When this expression is sent to the /stream handler it responds with:
 }
 ----
 
-== Creating a Vector with the *col* Function
+== Creating a Vector with the col Function
 
 The `col` function iterates over a list of tuples and copies the values
-from a specific column into an *array*.
+from a specific column into an array.
 
 The output of the `col` function is an numeric array that can be set to a
 variable and operated on by math expressions.
@@ -157,7 +156,7 @@ let(a=random(collection1, q="*:*", rows="3", fl="price_f"),
 
 Once a vector has been created any math expression that operates on vectors
 can be applied. In the example below the `mean` function is applied to
-the vector assigned to variable *b*.
+the vector assigned to variable *`b`*.
 
 [source,text]
 ----
@@ -166,7 +165,7 @@ let(a=random(collection1, q="*:*", rows="15000", fl="price_f"),
     c=mean(b))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -191,13 +190,14 @@ Matrices can be created by vectorizing multiple numeric fields
 and adding them to a matrix. The matrices can then be operated on by
 any math expression that operates on matrices.
 
+[TIP]
+====
 Note that this section deals with the creation of matrices
-from numeric data. The next chapter of the user guide covers
-Text Analysis and Term Vectors which describes how to build TF-IDF
-term vector matrices from text fields.
+from numeric data. The section <<term-vectors.adoc#term-vectors,Text Analysis and Term Vectors>> describes how to build TF-IDF term vector matrices from text fields.
+====
 
 Below is a simple example where four random samples are taken
-from different sub-populations in the data. The *price_f* field of
+from different sub-populations in the data. The `price_f` field of
 each random sample is
 vectorized and the vectors are added as rows to a matrix.
 Then the `sumRows`
@@ -218,7 +218,7 @@ let(a=random(collection1, q="market:A", rows="5000", fl="price_f"),
     j=sumRows(i))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -244,14 +244,14 @@ When this expression is sent to the /stream handler it responds with:
 
 == Latitude / Longitude Vectors
 
-The `latlonVectors` function wraps a list of tuples and parses a lat/long location field into
+The `latlonVectors` function wraps a list of tuples and parses a lat/lon location field into
 a matrix of lat/long vectors. Each row in the matrix is a vector that contains the lat/long
 pair for the corresponding tuple in the list. The row labels for the matrix are
-automatically set to the *id* field in the tuples. The the lat/lon matrix can then be operated
-on by distance based machine learning functions using the `haversineMeters` distance measure.
+automatically set to the `id` field in the tuples. The lat/lon matrix can then be operated
+on by distance-based machine learning functions using the `haversineMeters` distance measure.
 
 The `latlonVectors` function takes two parameters: a list of tuples and a named parameter called
-*field*. The field parameter tells the `latlonVectors` function which field to parse the lat/lon
+`field`, which tells the `latlonVectors` function which field to parse the lat/lon
 vectors from.
 
 Below is an example of the `latlonVectors`.
@@ -262,7 +262,7 @@ let(a=random(collection1, q="*:*", fl="id, loc_p", rows="5"),
     b=latlonVectors(a, field="loc_p"))
 ----
 
-When this expression is sent to the /stream handler it responds with:
+When this expression is sent to the `/stream` handler it responds with:
 
 [source,json]
 ----
@@ -301,5 +301,3 @@ When this expression is sent to the /stream handler it responds with:
   }
 }
 ----
-
-