ref guide: several minor edits

This commit is contained in:
Steve Rowe 2017-10-20 16:49:01 -04:00
parent 188c26c8b7
commit dfd13624c2
3 changed files with 17 additions and 13 deletions

View File

@ -82,9 +82,10 @@ The table below summarizes the functions available for function queries.
=== abs Function === abs Function
Returns the absolute value of the specified value or function. Returns the absolute value of the specified value or function.
*Syntax Example* *Syntax Examples*
* `abs(x)` `abs(-5)` * `abs(x)`
* `abs(-5)`
=== childfield(field) Function === childfield(field) Function
Returns the value of the given field for one of the matched child docs when searching by <<other-parsers.adoc#block-join-parent-query-parser,{!parent}>>. It can be used only in `sort` parameter. Returns the value of the given field for one of the matched child docs when searching by <<other-parsers.adoc#block-join-parent-query-parser,{!parent}>>. It can be used only in `sort` parameter.
@ -113,9 +114,10 @@ Specifies a floating point constant.
=== def Function === def Function
`def` is short for default. Returns the value of field "field", or if the field does not exist, returns the default value specified. Yields the first value where `exists()==true`. `def` is short for default. Returns the value of field "field", or if the field does not exist, returns the default value specified. Yields the first value where `exists()==true`.
*Syntax Example* *Syntax Examples*
* `def(rating,5)`: This `def()` function returns the rating, or if no rating specified in the doc, returns 5 `def(myfield, 1.0):` equivalent to `if(exists(myfield),myfield,1.0)` * `def(rating,5)`: This `def()` function returns the rating, or if no rating specified in the doc, returns 5
* `def(myfield, 1.0):` equivalent to `if(exists(myfield),myfield,1.0)`
=== div Function === div Function
Divides one value or function by another. `div(x,y)` divides `x` by `y`. Divides one value or function by another. `div(x,y)` divides `x` by `y`.
@ -224,7 +226,7 @@ If the value of `x` does not fall between `min` and `max`, then either the value
** `map(x,0,0,1)`: Changes any values of 0 to 1. This can be useful in handling default 0 values. ** `map(x,0,0,1)`: Changes any values of 0 to 1. This can be useful in handling default 0 values.
* `map(x,min,max,target,default)` * `map(x,min,max,target,default)`
** `map(x,0,100,1,-1)`: Changes any values between `0` and `100` to `1`, and all other values to` -1`. ** `map(x,0,100,1,-1)`: Changes any values between `0` and `100` to `1`, and all other values to` -1`.
* `map(x,0,100,sum(x,599),docfreq(text,solr))`: Changes any values between `0` and `100` to x+599, and all other values to frequency of the term 'solr' in the field text. ** `map(x,0,100,sum(x,599),docfreq(text,solr))`: Changes any values between `0` and `100` to x+599, and all other values to frequency of the term 'solr' in the field text.
=== max Function === max Function
Returns the maximum numeric value of multiple nested functions or constants, which are specified as arguments: `max(x,y,...)`. The `max` function can also be useful for "bottoming out" another function or field at some specified constant. Returns the maximum numeric value of multiple nested functions or constants, which are specified as arguments: `max(x,y,...)`. The `max` function can also be useful for "bottoming out" another function or field at some specified constant.
@ -330,7 +332,7 @@ Returns the product of multiple values or functions, which are specified in a co
* `product(x,y,...)` * `product(x,y,...)`
* `product(x,2)` * `product(x,2)`
* `product(x,y)mul(x,y)` * `mul(x,y)`
=== query Function === query Function
Returns the score for the given subquery, or the default value for documents not matching the query. Any type of subquery is supported through either parameter de-referencing `$otherparam` or direct specification of the query string in the <<local-parameters-in-queries.adoc#local-parameters-in-queries,Local Parameters>> through the `v` key. Returns the score for the given subquery, or the default value for documents not matching the query. Any type of subquery is supported through either parameter de-referencing `$otherparam` or direct specification of the query string in the <<local-parameters-in-queries.adoc#local-parameters-in-queries,Local Parameters>> through the `v` key.
@ -379,9 +381,11 @@ The Square Euclidean distance calculates the 2-norm (Euclidean distance) but doe
=== sqrt Function === sqrt Function
Returns the square root of the specified value or function. Returns the square root of the specified value or function.
*Syntax Example* *Syntax Examples*
* `sqrt(x)sqrt(100)sqrt(sum(x,100))` * `sqrt(x)`
* `sqrt(100)`
* `sqrt(sum(x,100))`
=== strdist Function === strdist Function
Calculate the distance between two strings. Uses the Lucene spell checker `StringDistance` interface and supports all of the implementations available in that package, plus allows applications to plug in their own via Solr's resource loading capabilities. `strdist` takes (string1, string2, distance measure). Calculate the distance between two strings. Uses the Lucene spell checker `StringDistance` interface and supports all of the implementations available in that package, plus allows applications to plug in their own via Solr's resource loading capabilities. `strdist` takes (string1, string2, distance measure).
@ -410,8 +414,8 @@ Returns the sum of multiple values or functions, which are specified in a comma-
*Syntax Examples* *Syntax Examples*
* `sum(x,y,...) sum(x,1)` * `sum(x,y,...)`
* `sum(x,y)` * `sum(x,1)`
* `sum(sqrt(x),log(y),z,0.5)` * `sum(sqrt(x),log(y),z,0.5)`
* `add(x,y)` * `add(x,y)`

View File

@ -442,7 +442,7 @@ This parameter is global; for per-field usage, see `split`.
Example: `encapsulator="` Example: `encapsulator="`
`escape`:: The character used for escaping CSV separators or other reserved characters. If an escape is specified, the encapsulator is not used unless also explicitly specified since most formats use either encapsulation or escaping, not both. |g | `escape`:: The character used for escaping CSV separators or other reserved characters. If an escape is specified, the encapsulator is not used unless also explicitly specified since most formats use either encapsulation or escaping, not both. |g |
+
Example: `escape=\` Example: `escape=\`
`keepEmpty`:: `keepEmpty`::

View File

@ -31,7 +31,7 @@ When using the Solr Cell framework, it is helpful to keep the following in mind:
* Tika will automatically attempt to determine the input document type (Word, PDF, HTML) and extract the content appropriately. If you like, you can explicitly specify a MIME type for Tika with the `stream.type` parameter. * Tika will automatically attempt to determine the input document type (Word, PDF, HTML) and extract the content appropriately. If you like, you can explicitly specify a MIME type for Tika with the `stream.type` parameter.
* Tika works by producing an XHTML stream that it feeds to a SAX ContentHandler. SAX is a common interface implemented for many different XML parsers. For more information, see http://www.saxproject.org/quickstart.html. * Tika works by producing an XHTML stream that it feeds to a SAX ContentHandler. SAX is a common interface implemented for many different XML parsers. For more information, see http://www.saxproject.org/quickstart.html.
* Solr then responds to Tika's SAX events and creates the fields to index. * Solr then responds to Tika's SAX events and creates the fields to index.
* Tika produces metadata such as Title, Subject, and Author according to specifications such as the DublinCore. See http://tika.apache.org/1.7/formats.html for the file types supported. * Tika produces metadata such as Title, Subject, and Author according to specifications such as the DublinCore. See http://tika.apache.org/1.16/formats.html for the file types supported.
* Tika adds all the extracted text to the `content` field. * Tika adds all the extracted text to the `content` field.
* You can map Tika's metadata fields to Solr fields. * You can map Tika's metadata fields to Solr fields.
* You can pass in literals for field values. Literals will override Tika-parsed values, including fields in the Tika metadata object, the Tika content field, and any "captured content" fields. * You can pass in literals for field values. Literals will override Tika-parsed values, including fields in the Tika metadata object, the Tika content field, and any "captured content" fields.
@ -149,7 +149,7 @@ Defines a file path and name to a customized Tika configuration file. This is on
Prefixes all fields that are not defined in the schema with the given prefix. This is very useful when combined with dynamic field definitions. Example: `uprefix=ignored_` would effectively ignore all unknown fields generated by Tika given the example schema contains `<dynamicField name="ignored_*" type="ignored"/>` Prefixes all fields that are not defined in the schema with the given prefix. This is very useful when combined with dynamic field definitions. Example: `uprefix=ignored_` would effectively ignore all unknown fields generated by Tika given the example schema contains `<dynamicField name="ignored_*" type="ignored"/>`
`xpath`:: `xpath`::
When extracting, only return Tika XHTML content that satisfies the given XPath expression. See http://tika.apache.org/1.7/index.html for details on the format of Tika XHTML. See also http://wiki.apache.org/solr/TikaExtractOnlyExampleOutput. When extracting, only return Tika XHTML content that satisfies the given XPath expression. See http://tika.apache.org/1.16/index.html for details on the format of Tika XHTML. See also http://wiki.apache.org/solr/TikaExtractOnlyExampleOutput.
== Order of Operations == Order of Operations