From a5b1327aec3648f1582562ca5cfdcf024fa14a38 Mon Sep 17 00:00:00 2001 From: Joel Bernstein Date: Fri, 16 Jun 2017 14:03:13 -0400 Subject: [PATCH] Ref Guide: Add pow evaluator docs --- .../solr-ref-guide/src/stream-evaluators.adoc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/solr/solr-ref-guide/src/stream-evaluators.adoc b/solr/solr-ref-guide/src/stream-evaluators.adoc index 3702f391c95..aec9bd2d770 100644 --- a/solr/solr-ref-guide/src/stream-evaluators.adoc +++ b/solr/solr-ref-guide/src/stream-evaluators.adoc @@ -192,7 +192,24 @@ if(gt(fieldA,fieldB),sub(fieldA,fieldB),sub(fieldB,fieldA)) // if fieldA > field ---- == pow -//TODO +The `pow` function returns the value of its first parameter raised to the power of its second parameter. + +=== pow Parameters + +* `Field Name | Raw Number | Number Evaluator`: Parameter 1 +* `Field Name | Raw Number | Number Evaluator`: Parameter 2 + +=== pow Syntax + +The expressions below show the various ways in which you can use the `pow` evaluator. + +[source,text] +---- +pow(2,3) // returns 2 raised to the 3rd power. +pow(4,fieldA) // returns 4 raised by the value of fieldA. +pow(fieldA,1.4) // returns the value of fieldA raised by 1.4. +if(gt(fieldA,fieldB),pow(fieldA,fieldB),pow(fieldB,fieldA)) // if fieldA > fieldB then raise fieldA by fieldB, else raise fieldB by fieldA. +---- == mod //TODO