Hello, Basically i need the count how many SearchResultEntry responses you get from ldap_search_s().
Note : Pardon, i have mistakenly typed "ldap_search()" instead of "ldap_search_s()
"true/false for the particular filter" means following : 1.) If execute a filter , respond with >0 entry ---> true 2.) If execute a filter , respond with = 0 entry --> false.
Note : i have nothing to do with the attributes for the corresponding entries return for the search. So i am looking for a optimized way here which just let me know if any entry is available or not for particular filter.
Regards, PKHUN
On Wed, Sep 5, 2012 at 11:17 PM, Pierangelo Masarati < pierangelo.masarati@polimi.it> wrote:
Hello,
I am facing an issue to get the result of a filter.
Currently i have used the ldap_search () function to see whether AD has some entity corresponding to particular filter execution. But i am not able to find the function which returns the number of
entity
for the particular filter execution. Please help me to get the correct function which return the number of entity for the particular filter execution and what pre-requesties it
has.
You need to count how many SearchResultEntry responses you get from ldap_search(). Or, if slapd is configured to use the "noopsrch" module, which implements the "noopsrch" control http://www.openldap.org/faq/data/cache/1509.html, you get no results but a control response that indicates, among other things, how many entries would be returned by that search. I'm not sure what you mean by "pre-requesties".
If possible, please suggest function which just return true/false for the particular filter.
Please specify what "true/false for the particular filter" means.
p.
-- Pierangelo Masarati Associate Professor Dipartimento di Ingegneria Aerospaziale Politecnico di Milano
Puneet Khunteta wrote:
Basically i need the count how many SearchResultEntry responses you get from ldap_search_s().
You won't get the count without retrieving the results.
"true/false for the particular filter" means following : 1.) If execute a filter , respond with >0 entry ---> true 2.) If execute a filter , respond with = 0 entry --> false.
Note : i have nothing to do with the attributes for the corresponding entries return for the search. So i am looking for a optimized way here which just let me know if any entry is available or not for particular filter.
This is something different: Simply set sizelimit=1 when using ldap_search_ext_s() and return true if one result was received.
Ciao, Michael.
Hello, "You won't get the count without retrieving the results." I believe when you call a ldap_search_s(), the last argument of the function LDAPmessage *result stores the result from the ldap search. If it is true, what should be the next call to get the number of entries ? and if not, what should be the functions call that i have to make to get the count.
Regards, PKHUN
On Thu, Sep 6, 2012 at 12:33 AM, Michael Ströder michael@stroeder.comwrote:
Puneet Khunteta wrote:
Basically i need the count how many SearchResultEntry responses you get
from
ldap_search_s().
You won't get the count without retrieving the results.
"true/false for the particular filter" means following : 1.) If execute a filter , respond with >0 entry ---> true 2.) If execute a filter , respond with = 0 entry --> false.
Note : i have nothing to do with the attributes for the corresponding
entries
return for the search. So i am looking for a optimized way here which
just let
me know if any entry is available or not for particular filter.
This is something different: Simply set sizelimit=1 when using ldap_search_ext_s() and return true if one result was received.
Ciao, Michael.
--On Wednesday, September 05, 2012 9:03 PM +0200 Michael Ströder michael@stroeder.com wrote:
Puneet Khunteta wrote:
Basically i need the count how many SearchResultEntry responses you get from ldap_search_s().
You won't get the count without retrieving the results.
Incorrect. You can use the noop control to do this. We actually do this now in Zimbra to get the total number of accounts in LDAP without having to get the full result set back.
--Quanah
--
Quanah Gibson-Mount Sr. Member of Technical Staff Zimbra, Inc A Division of VMware, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
Quanah Gibson-Mount wrote:
--On Wednesday, September 05, 2012 9:03 PM +0200 Michael Ströder michael@stroeder.com wrote:
Puneet Khunteta wrote:
Basically i need the count how many SearchResultEntry responses you get from ldap_search_s().
You won't get the count without retrieving the results.
Incorrect. You can use the noop control to do this.
How many LDAP servers support this control?
Which text in http://tools.ietf.org/html/draft-zeilenga-ldap-noop-12 defines how the count of search results is returned when no-op control was sent along with a search request?
Ciao, Michael.
Quanah,
Michael Ströder wrote:
Quanah Gibson-Mount wrote:
--On Wednesday, September 05, 2012 9:03 PM +0200 Michael Ströder michael@stroeder.com wrote:
You won't get the count without retrieving the results.
Incorrect. You can use the noop control to do this.
How many LDAP servers support this control?
Which text in http://tools.ietf.org/html/draft-zeilenga-ldap-noop-12 defines how the count of search results is returned when no-op control was sent along with a search request?
I guess you referred to what was discussed in ITS#6598. Was this ever implemented in a normal OpenLDAP release?
Because I tried ldapsearch -e noop with 2.4.32 and it returned all results.
Ciao, Michael.
--On Monday, September 10, 2012 8:28 PM +0200 Michael Ströder michael@stroeder.com wrote:
Quanah,
Michael Ströder wrote:
Quanah Gibson-Mount wrote:
--On Wednesday, September 05, 2012 9:03 PM +0200 Michael Ströder michael@stroeder.com wrote:
You won't get the count without retrieving the results.
Incorrect. You can use the noop control to do this.
How many LDAP servers support this control?
Which text in http://tools.ietf.org/html/draft-zeilenga-ldap-noop-12 defines how the count of search results is returned when no-op control was sent along with a search request?
I guess you referred to what was discussed in ITS#6598. Was this ever implemented in a normal OpenLDAP release?
Because I tried ldapsearch -e noop with 2.4.32 and it returned all results.
We use it all the time, it works fine.
--Quanah
--
Quanah Gibson-Mount Sr. Member of Technical Staff Zimbra, Inc A Division of VMware, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
Quanah Gibson-Mount wrote:
Michael Ströder wrote: I guess you referred to what was discussed in ITS#6598. Was this ever implemented in a normal OpenLDAP release?
Because I tried ldapsearch -e noop with 2.4.32 and it returned all results.
We use it all the time, it works fine.
Hmm, I would expect the following command *not* to return results but a LDIF line starting with "control:".
ldapsearch -e 1.3.6.1.4.1.4203.666.5.18 "(objectClass=person)" 1.1
But I get the normal search results. BTW: I'm using back-mdb.
Ciao, Michael.
--On Tuesday, September 11, 2012 12:33 AM +0200 Michael Ströder michael@stroeder.com wrote:
But I get the normal search results. BTW: I'm using back-mdb.
And have you applied the overlay to your database?
zimbra@zre-ldap001:~/data/ldap/config/cn=config/olcDatabase={2}mdb$ ls -l total 12 -rw-r--r-- 1 zimbra zimbra 405 Sep 10 07:37 olcOverlay={0}dynlist.ldif -rw-r--r-- 1 zimbra zimbra 467 Sep 10 07:37 olcOverlay={1}unique.ldif -rw-r--r-- 1 zimbra zimbra 335 Sep 10 07:37 olcOverlay={2}noopsrch.ldif
zimbra@zre-ldap001:~/data/ldap/config/cn=config/olcDatabase={2}mdb$ cat olcOverlay={2}noopsrch.ldif dn: olcOverlay={2}noopsrch objectClass: olcOverlayConfig olcOverlay: {2}noopsrch structuralObjectClass: olcOverlayConfig entryUUID: d3bebaca-e879-1030-8e37-79dfe90691d8 creatorsName: cn=config createTimestamp: 20120210212749Z entryCSN: 20120210212749.829019Z#000000#000#000000 modifiersName: cn=config modifyTimestamp: 20120210212749Z
--Quanah
--
Quanah Gibson-Mount Sr. Member of Technical Staff Zimbra, Inc A Division of VMware, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
Quanah Gibson-Mount wrote:
--On Tuesday, September 11, 2012 12:33 AM +0200 Michael Ströder michael@stroeder.com wrote:
But I get the normal search results. BTW: I'm using back-mdb.
And have you applied the overlay to your database?
Ah, this is the missing part. Compiling...
Ciao, Michael.
openldap-technical@openldap.org