Apache Lucene open-source search software
SOLR-12913: Add ltrim and rtrim to the Math Expressions User Guide
Joel Bernstein01397c1b8888
diff --git a/solr/solr-ref-guide/src/vector-math.adoc b/solr/solr-ref-guide/src/vector-math.adocindex 6171d77e9dc..cb4ef1d8058 100644--- a/solr/solr-ref-guide/src/vector-math.adoc+++ b/solr/solr-ref-guide/src/vector-math.adoc@@ -143,6 +143,41 @@ When this expression is sent to the `/stream` handler it responds with:}----+Elements of an array can be trimmed using the `ltrim` (left trim) and `rtrim` (right trim) functions.+The `ltrim` and `rtrim` functions remove a specific number of elements from the left or right of an array.++The example below shows the `lrtim` function trimming the first 2 elements of an array:++[source,text]+----+ltrim(array(0,1,2,3,4,5,6))+----++When this expression is sent to the `/stream` handler it responds with:++[source,json]+----+{+ "result-set": {+ "docs": [+ {+ "return-value": [+ 2,+ 3,+ 4,+ 5,+ 6,+ ]+ },+ {+ "EOF": true,+ "RESPONSE_TIME": 1+ }+ ]+ }+}+----+== Vector SortingAn array can be sorted in natural ascending order with the `asc` function.diff --git a/solr/solr-ref-guide/src/vectorization.adoc b/solr/solr-ref-guide/src/vectorization.adocindex 9483cc38c61..5c08a586c59 100644--- a/solr/solr-ref-guide/src/vectorization.adoc+++ b/solr/solr-ref-guide/src/vectorization.adoc@@ -250,15 +250,15 @@ When this expression is sent to the `/stream` handler it responds with:== Facet Co-occurrence Matrices-The `facet` function can be used to quickly perform mulit-dimension aggregations of categorical data from+The `facet` function can be used to quickly perform multi-dimension aggregations of categorical data fromrecords stored in a Solr Cloud collection. These multi-dimension aggregations can represent co-occurrencecounts for the values in the dimensions. The `pivot` function can be used to move two dimensionalaggregations into a co-occurrence matrix. The co-occurrence matrix can then be clustered or analyzed forcorrelations to learn about the hidden connections within the data.-In the example below th `facet` expression is used to generate a two dimensional faceted aggregation.+In the example below the `facet` expression is used to generate a two dimensional faceted aggregation.The first dimension is the US State that a car was purchased in and the second dimension is the car model.-The two dimensional facet generates the co-occurrence counts for the number of times a particular car model+This two dimensional facet generates the co-occurrence counts for the number of times a particular car modelwas purchased in a particular state.@@ -311,7 +311,7 @@ When this expression is sent to the `/stream` handler it responds with:The `pivot` function can be used to move the facet results into a co-occurrence matrix. In the example belowThe `pivot` function is used to create a matrix where the rows of the matrix are the US States (state) and thecolumns of the matrix are the car models (model). The values in the matrix are the co-occurrence counts (count(*))- from facet results. Once the co-occurrence matrix has been created the US States can be clustered+ from the facet results. Once the co-occurrence matrix has been created the US States can be clusteredby car model, or the matrix can be transposed and car models can be clustered by the US Stateswhere they were bought.