@@ -3120,31 +3120,39 @@ while($arr_matches = $redis->zScan('zset', $it, '*pattern*')) {
3120
3120
### pfAdd
3121
3121
-----
3122
3122
3123
+ _ ** Description** _ : Adds the specified elements to the specified HyperLogLog.
3124
+
3123
3125
##### * Prototype*
3124
3126
~~~ php
3125
3127
$redis->pfAdd($key, Array $elements);
3126
3128
~~~
3127
3129
3128
- _ ** Description** _ : Adds the specified elements to the specified HyperLogLog.
3130
+ ##### * Parameters*
3131
+ _ Key_
3132
+ _ Array of values_
3129
3133
3130
3134
##### * Return value*
3131
3135
* Integer* : 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.
3132
3136
3133
3137
##### * Example*
3134
3138
~~~ php
3135
- $redis->pfAdd('hll', ['a', 'b', 'c']);
3139
+ $redis->pfAdd('hll', ['a', 'b', 'c']); // (int) 1
3140
+ $redis->pfAdd('hll', ['a', 'b']); // (int) 0
3136
3141
~~~
3137
3142
3138
3143
### pfCount
3139
3144
-----
3140
3145
3146
+ _ ** Description** _ : Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
3147
+
3141
3148
##### * Prototype*
3142
3149
~~~ php
3143
3150
$redis->pfCount($key);
3144
3151
$redis->pfCount(Array $keys);
3145
3152
~~~
3146
3153
3147
- _ ** Description** _ : Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
3154
+ ##### * Parameters*
3155
+ _ Key_ or _ Array of keys_
3148
3156
3149
3157
##### * Return value*
3150
3158
* Integer* : The approximated number of unique elements observed via [ pfAdd] ( #pfAdd ) .
@@ -3163,6 +3171,30 @@ $redis->pfCount(['hll1', 'hll2']); // (int) 5
3163
3171
### pfMerge
3164
3172
-----
3165
3173
3174
+ _ ** Description** _ : Merge N different HyperLogLogs into a single one.
3175
+
3176
+ ##### * Prototype*
3177
+ ~~~ php
3178
+ $redis->pfMerge($destkey, Array $sourceKeys);
3179
+ ~~~
3180
+
3181
+ ##### * Parameters*
3182
+ _ Destination Key_
3183
+ _ Array of Source Keys_
3184
+
3185
+ ##### * Return value*
3186
+ * BOOL* : ` TRUE ` on success, ` FALSE ` on error.
3187
+
3188
+ ##### * Example*
3189
+ ~~~ php
3190
+ $redis->pfAdd('hll1', ['a', 'b', 'c']); // (int) 1
3191
+ $redis->pfAdd('hll2', ['d', 'e', 'a']); // (int) 1
3192
+
3193
+ $redis->pfMerge('hll3', ['hll1', 'hll2']); // true
3194
+
3195
+ $redis->pfCount('hll3'); // (int) 5
3196
+ ~~~
3197
+
3166
3198
## Geocoding
3167
3199
3168
3200
### geoAdd
0 commit comments