简体   繁体   English

在LDAP搜索过滤器中,是否可以要求一个多值字段的第一个,第二个,第n个或最后一个值?

[英]In an LDAP search filter, is it possible to ask for the 1st, 2nd, nth, or last value of a multi-valued field?

Using a search filter, is it possible to retrieve the last value of a multi-valued field for an object eg the department field of the inetOrgPerson? 使用搜索过滤器,是否可以检索对象的多值字段的最后一个值,例如inetOrgPerson的部门字段?

For instance, if my user cn=Alice has 2 values for department, can I somehow write a search filter that will return the last value only? 例如,如果我的用户cn = Alice具有部门的2个值,我可以以某种方式编写仅返回最后一个值的搜索过滤器吗?

Thanks. 谢谢。

LDAPSearch filters are meant to find and filter LDAP entries. LDAPSearch过滤器用于查找和过滤LDAP条目。 In the LDAP request, the list of attributes to retrieve is a separate parameter from the filter. 在LDAP请求中,要检索的属性列表是与过滤器不同的参数。 An LDAP Extension (a Control) exists to specify to match and retrieve only matching values of a multi-valued attribute, specified in RFC 3876. This extension is not implemented in all LDAP directory services, nor in all LDAP clients. 存在LDAP扩展(控件),用于指定以仅匹配和检索RFC 3876中指定的多值属性的匹配值。并非在所有LDAP目录服务或所有LDAP客户端中都实现此扩展。

I found a draft for ordered entries and values: 我找到了有序条目和值的草稿:

https://tools.ietf.org/html/draft-chu-ldap-xordered-00 https://tools.ietf.org/html/draft-chu-ldap-xordered-00

If your LDAP server implements this schema extension you might succeed in searching for the nth value of a multi-valued attribute 如果您的LDAP服务器实现此架构扩展,则您可能会成功搜索多值属性的第n个值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM