如何在LDAP上运行范围查询 [英] How do I run range queries on LDAP

查看:683
本文介绍了如何在LDAP上运行范围查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检索有关LDAP上的组的数据.由于需要分页结果,因此需要运行范围查询.我的设置使用JNDI连接到LDAP.我正在尝试运行此查询

 (&(objectclass=group)(range=1-500))

我做错了什么?我知道有针对LDAP的基于范围的查询,如何修改此查询以获得相同的查询?

解决方案

好的分页是一回事,范围是另一回事.当条目数超过1000(至少这是Active Directory中的默认值)时,您将分页从LDAP服务器获取的结果.

MSDN上有有关如何在.NET中进行分页搜索的文章;希望您可以将其转换为您的环境.

范围是有所不同.当具有多个值的多值属性(通常为组的member属性)时,可以使用范围.因此,查询中不能包含范围.在访问多值属性时,您需要指定范围(然后在访问属性值的代码中仅指定member;range=1-500而不是直接指定member即可从该多值属性中获取前500个值).

I am trying to retrieve data about groups on LDAP. As I need to paginate results, I need to run range queries. My setup uses JNDI to connect to LDAP. I am trying to run this query

 (&(objectclass=group)(range=1-500))

What am I doing wrong? I know there are range based queries for LDAP,how do I modify this query for get the same?

解决方案

Well paging is one thing and range is another. You page the results that you get back from the LDAP server when there are more than 1000 entries (at least that's the default in Active Directory).

MSDN has an article on how to do paged searches in .NET; hopefully you can translate that to your environment.

Range is something different. You use range when you have a multi-value-attribute (commonly the member-attribute for a group) that has a large number of values. So you can't have range in the query. You need to specify the range when you access the multi-value-attribute (then instead of just specifying member in the code accessing the property value you specify member;range=1-500 to get the first 500 values from that multivalue attribute).

这篇关于如何在LDAP上运行范围查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆