PHPillow 中用于 CouchDB 的 Reduce 函数

发布于 2024-11-10 02:17:21 字数 663 浏览 1 评论 0原文

我正在尝试在 PHPillow 中执行(MapReduce 的)reduce 函数,目前它尚未记录,但我确实需要这样做。有谁有在 PHPillow 中实现 Reduce 函数的示例吗?

http:// Arbitr.org/phpillow/download.html <--这就是 PHPillow

I'从 Futon 或法线贴图函数执行此操作没有任何问题,这是我遇到的缩减函数。

这是代码中的

* A reduce function may be used to aggregate / reduce the results
 * calculated by a view function. See the CouchDB documentation for more
 * results: @TODO: Not yet documented.
 *
 * Each view reduce function MUST have a view definition with the same
 * name, otherwise there is nothing to reduce.

感谢您的帮助,

--Scott

I'm trying to do a reduce function (of MapReduce) in PHPillow and currently it's undocumented, however I really need to do it. Does anyone have an example of implementing a Reduce Function within PHPillow?

http://arbitracker.org/phpillow/download.html <--That's PHPillow

I've had no problems with doing so from Futon or normal map functions, it's the reduce functions I'm being held up by.

This is in the code

* A reduce function may be used to aggregate / reduce the results
 * calculated by a view function. See the CouchDB documentation for more
 * results: @TODO: Not yet documented.
 *
 * Each view reduce function MUST have a view definition with the same
 * name, otherwise there is nothing to reduce.

Thanks for your help,

--Scott

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不可一世的女人 2024-11-17 02:17:21

首先我要说的是我不太了解 PHPillow 或 CouchDB。

但是,从表面上看,Reduce 函数是在 CouchDb 服务器上编写并注册的。然后在 view_file.php 中引用它 - 按照示例定义数组...第 35-57 行。

然后,当您调用 verifyView() 时,它将执行定义的减少,这反过来意味着您可以通过 $views[$name]['reduce'] 访问它。

正如我所说,我只是根据课程中的少量信息和 couchdb 的有关 reduce 的信息进行猜测。

I will start by saying I don't know a lot of PHPillow or CouchDB.

But, by the looks of it, a Reduce function is written and registered on the CouchDb server. and it is then referenced in view_file.php - define the array as per their example... lines 35-57.

Then when you call verifyView(), it will perform the reduces defined, which in turn means you can then access it via $views[$name]['reduce'] perhaps.

As I said, I am just guessing from the little info in the classes and couchdb's info about reduce.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文