How to get more search results than the server#39;s sizelimit with Python LDAP?(如何使用 Python LDAP 获得比服务器的 sizelimit 更多的搜索结果?)
问题描述
我正在使用 python-ldap 模块来(除其他外)搜索组,并且正在运行服务器的大小限制并获得 SIZELIMIT_EXCEEDED 异常.我已经尝试过同步和异步搜索,并以两种方式解决了问题.
I am using the python-ldap module to (amongst other things) search for groups, and am running into the server's size limit and getting a SIZELIMIT_EXCEEDED exception. I have tried both synchronous and asynchronous searches and hit the problem both ways.
您应该能够通过在搜索上设置分页控件来解决此问题,但根据 python-ldap 文档,这些控件尚未为 search_ext() 实现.有没有办法在 Python 中做到这一点?如果 python-ldap 库不支持,是否还有其他 Python 库支持?
You are supposed to be able to work round this by setting a paging control on the search, but according to the python-ldap docs these controls are not yet implemented for search_ext(). Is there a way to do this in Python? If the python-ldap library does not support it, is there another Python library that does?
推荐答案
这里有一些与python-ldap中分页相关的链接.
Here are some links related to paging in python-ldap.
- 文档:http://www.python-ldap.org/doc/html/ldap-controls.html#ldap.controls.SimplePagedResultsControl
- 使用分页的示例代码:http://www.novell.com/coolsolutions/tip/18274.html
- 更多示例代码:http://google-apps-for-your-domain-ldap-sync.googlecode.com/svn/trunk/ldap_ctxt.py
这篇关于如何使用 Python LDAP 获得比服务器的 sizelimit 更多的搜索结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 Python LDAP 获得比服务器的 sizelimit 更多的搜索结果?
基础教程推荐
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
