On Thu, 13 Apr 2006, Jeff Saxton wrote:

> See this:
>
> http://www.ietf.org/rfc/rfc2891.txt

Ah, thank you for the help. Actually it seems the ldap_sort() in php is
using this extension. That explained a lot.

Sadly I don't see the possibility to sort reversed order using ldap_sort()
in php. The protocol support reverse order, but php library seems not. Too
bad because 95% of my sorts (happen to) should be in reversed order (e.g.
search by the date of creation/latest first, search by modify date/updated
first, search by degree in college/higher level first, search by company
investment/rich companies first). The only thing seems should be ordered
small-to-big is the person's sirname. Finally reversed search is done on php
side by trying to retrieve the entry from last to first (a lot of work).
This is just FYI.

>
>
> Zhang Weiwu wrote:
> > 在 2006-04-13四的 06:33 -0400,Adam Tauno Williams写道:
> >
> >>>I suspect (guess) the sorting is actually done in a very simple way by the
> >>>LDAP client:
> >>>1) the client (ldap_search or php) connect to the LDAP server and search
> >>>with filter, ask the server to return only the search key attribute.
> >>>2) 1,000 search keys are returned from server (along with dn);
> >>>3) the client sort the keys, and determin which are the first 20 items;
> >>>4) and query LDAP server again ask for the 20 items.
> >>
> >>That is a dumb design;  if you've already got the records, and sorted
> >>them, why do the query again?  Even web scripting languages like PHP let
> >>you store an array in a session, so you only need to get the data once,
> >>and then display different sections.
> >
> >
> > I supppose I should first get as less data as possible in order to do
> > the sorting, and ten retrieve a section of entries of full data. In the
> > application I am currently working on, there are about 30,000 entries in
> > the LDAP server (the data was stored in another application which is
> > going to be ported to my web application). Simply retrieving and storing
> > these data in array exceeds memory limits and cannot stand more then 10
> > querys per minute. In most cases, we need to sort the data, display a
> > small section (20 entries). I am not sure, if simply retrieve all 'cn'
> > of all the contacts in order to sort them, would be too resource-hungry.
> >
> > I am using openldap, is this DSA the one you said supporting sort on
> > server side (e.g. when using ldap_sort in php)?
> >
> >
> > ---
> > You are currently subscribed to [email protected] as: [EMAIL PROTECTED]
> > To unsubscribe send email to [EMAIL PROTECTED] with the word UNSUBSCRIBE as 
> > the SUBJECT of the message.
>
> --
> Jeff Saxton
> SenSage, Inc.
> 55 Hawthorne Street Suite 700
> San Francisco, CA 94105
> Phone:  415.808.5900
> Fax:    415.371.1385
> Direct: 415-808-5921
> Cell:   415-640-6392
> mailto:[EMAIL PROTECTED]
>
> Enterprise Security Analytics
>
> SenSage, the leading provider of enterprise security analytics, offers
> unparalleled performance and a scalable means for organizations to centrally
> aggregate, efficiently analyze, dynamically monitor and cost-effectively
> store massive volumes of event log data.

---
You are currently subscribed to [email protected] as: [EMAIL PROTECTED]
To unsubscribe send email to [EMAIL PROTECTED] with the word UNSUBSCRIBE as the 
SUBJECT of the message.

Reply via email to