PHPillow 中用于 CouchDB 的 Reduce 函数
我正在尝试在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先我要说的是我不太了解 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.