在 LDAP 搜索过滤器/查询中使用通配符 [英] using wildcards in LDAP search filters/queries
问题描述
我对 AD 和 LDAP 查询的了解非常有限,所以我有一个关于如何使用通配符的简单问题.
I have very limited knowledge in AD and LDAP queries so I have a simple question on how to use wildcards.
假设有一个显示名称为ITSM - 问题管理"的对象
Supposed there is object with a displayName of "ITSM - Problem Management"
我当前使用通配符实现的过滤器如下:
My current implementation of the filter with a wildcard is as such:
(displayName=SEARCHKEYWORD*)
如果用户输入关键字问题",他将无法找到该对象,因为它需要名称的第一部分,即ITSM -"
If a user would enter a keyword of "Problem", he wouldn't be able to find the object since it needs the first part of the name, that is "ITSM - "
我想在两端实现通配符,如下所示:
I would like to implement the wildcard on both ends like below:
(displayName=*SEARCHKEYWORD*)
理想情况下,这将允许输入问题"并让它搜索ITSM - 问题管理".但是当你把它放在开头时,通配符似乎不起作用.当我尝试时,它似乎只是挂断而不返回任何结果.
Ideally, this would allow the entry of "Problem" and have it search for "ITSM - Problem Management". But the wildcard doesn't seem to work when you put it at the start. When I tried it, it just seems to hang-up and not return any results.
关于如何解决此问题的任何想法或想法?任何输入将不胜感激.谢谢!
Any ideas or thoughts on how I can resolve this? Any input would be highly appreciated. Thanks!
推荐答案
带有尾随 * 的过滤器参数几乎可以通过索引查找立即进行评估.前导 * 意味着通过索引进行顺序搜索,因此它是 O(N).这需要很长时间.
A filter argument with a trailing * can be evaluated almost instantaneously via an index lookup. A leading * implies a sequential search through the index, so it is O(N). It will take ages.
我建议你重新考虑这个要求.
I suggest you reconsider the requirement.
这篇关于在 LDAP 搜索过滤器/查询中使用通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!