You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jb...@apache.org on 2017/06/16 18:19:08 UTC

lucene-solr:master: Ref Guide: Add mod evaluator docs

Repository: lucene-solr
Updated Branches:
  refs/heads/master a5b1327ae -> 584b69d3f


Ref Guide: Add mod evaluator docs


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/584b69d3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/584b69d3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/584b69d3

Branch: refs/heads/master
Commit: 584b69d3f20c7afa7c9af53bf0eac0eebc140b0c
Parents: a5b1327
Author: Joel Bernstein <jb...@apache.org>
Authored: Fri Jun 16 14:18:54 2017 -0400
Committer: Joel Bernstein <jb...@apache.org>
Committed: Fri Jun 16 14:18:54 2017 -0400

----------------------------------------------------------------------
 solr/solr-ref-guide/src/stream-evaluators.adoc | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/584b69d3/solr/solr-ref-guide/src/stream-evaluators.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/stream-evaluators.adoc b/solr/solr-ref-guide/src/stream-evaluators.adoc
index aec9bd2..bc6d13e 100644
--- a/solr/solr-ref-guide/src/stream-evaluators.adoc
+++ b/solr/solr-ref-guide/src/stream-evaluators.adoc
@@ -212,7 +212,23 @@ if(gt(fieldA,fieldB),pow(fieldA,fieldB),pow(fieldB,fieldA)) // if fieldA > field
 ----
 
 == mod
-//TODO
+The `mod` function returns the remainder (modulo) of the first parameter divided by the second parameter.
+
+=== mod Parameters
+
+* `Field Name | Raw Number | Number Evaluator`: Parameter 1
+* `Field Name | Raw Number | Number Evaluator`: Parameter 2
+
+=== mod Syntax
+
+The expressions below show the various ways in which you can use the `mod` evaluator.
+
+[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.
 
 === ceil
 //TODO