[Groonga-commit] droonga/droonga.org at fef9222 [gh-pages] Describe about collectors

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Mar 6 15:53:50 JST 2014


YUKI Hiroshi	2014-03-06 15:53:50 +0900 (Thu, 06 Mar 2014)

  New Revision: fef9222471ea8529ef5f4cd770c1f0294757966f
  https://github.com/droonga/droonga.org/commit/fef9222471ea8529ef5f4cd770c1f0294757966f

  Message:
    Describe about collectors

  Modified files:
    reference/plugin/collector/index.md

  Modified: reference/plugin/collector/index.md (+23 -5)
===================================================================
--- reference/plugin/collector/index.md    2014-03-06 15:52:22 +0900 (45cb46a)
+++ reference/plugin/collector/index.md    2014-03-06 15:53:50 +0900 (df43355)
@@ -9,8 +9,8 @@ layout: en
 
 ## Abstract {#abstract}
 
-A collector merges two input values to a result.
-The Droonga Engine tries to collect three or more values by applying the specified collector again and again.
+A collector merges two input values to single value.
+The Droonga Engine tries to collect three or more values by applying the specified collector for two of them again and again.
 
 ## Built-in collector classes {#builtin-collectors}
 
@@ -19,13 +19,31 @@ Of course they are avialable for your custom plugins.
 
 ### `Droonga::Collectors::And`
 
-(TBD)
+Returns a result from comparison of two values by the `and` logical operator.
+If both values are logically equal to `true`, then one of them (it is indeterminate) becomes the result.
+
+Values `null` (`nil`) and `false` are treated as `false`.
+Otherwise `true`.
 
 ### `Droonga::Collectors::Or`
 
-(TBD)
+Returns a result from comparison of two values by the `or` logical operator.
+If only one of them is logically equal to `true`, then the value becomes the result.
+Otherwise, if values are logically same, one of them (it is indeterminate) becomes the result.
+
+Values `null` (`nil`) and `false` are treated as `false`.
+Otherwise `true`.
 
 ### `Droonga::Collectors::Sum`
 
-(TBD)
+This collector works a little complicatedly.
+
+ * If one of values is equal to `null` (`nil`), then the other value becomes the result.
+ * If both values are hash, then a merged hash becomes the result.
+   * The result hash has all keys of two hashes.
+     If both have same keys, then one of their values appears as the value of the key in the reuslt hash.
+   * It is indeterminate which value becomes the base.
+ * Otherwise the result of `a + b` becomes the result.
+   * If they are arrays or strings, a concatenated value becomes the result.
+     It is indeterminate which value becomes the lefthand.
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index