Elier Delgado wrote:
> It's very strange but I need get random entries from the OpenLdap,
> specifically get randoms users (N users) .. it's a requirement of the
> system
> that I'm designing ....
>
> I'm using PHP and is not efficient get all results and do the random with
> the index of the result array ...because the results must be many ..
>
> And I'm not happy to apply a random to a filter values, for example
> generating randomly uid and getting near results ...
>
> So, I will appreciate any idea ...
Your description of the feature you seem to need is rather vague. What
do you mean? What's the requirement? A search is a well defined
operation in LDAP, so you need to clearly describe what you expect from
it when modified according to your needs.
For example:
- would it make any sense to receive more than one entry?
- would it be acceptable to receive the same entry twice during the same
search?
- would the search need to be complete? Namely, does your "randomness"
need to affect the (absence of) order in receiving the results, keeping
the set of returned data consistent with the search request and the
contents of the database, after applying appropriate access control,
size/time limits and so?
- ...
Technically, I don't see any particular criticality in implementing
something that complies with most of the above requirements, and in
general I don't see significant obstacles in implementing even fancier
stuff; but until you clarify what you want, I'm afraid no one would be
able to help you.
p.
Hi everyone, thank you for your help,
I offer excuses for not giving all the details and for my poor English.
The issue is that I'm designing a system that it will store many users and other info,
maybe in order of million ..(for this reason I don't want get all entries from PHP, it's abusive, for get only 10 or 20 entries ?)
>
>- would it make any sense to receive more than one entry?
>
I need get N random users or other N random objects, I think that this have sense
only if you search for particular ObjectClass.
N must be great than one and menor than a size control and SIZELIMIT ..
N >= 1, N <= size control, N <= SIZELIMIT
The result set must be computed before a time controls complete and TIMELIMIT ..
This must be clear ..
>
>- would it be acceptable to receive the same entry twice during the same
>search?
>
Maybe it not have sense getting the same entry twice during the same
search, but this could be useful for other case, so if could be defined
before operation, will be more general.
> Namely, does your "randomness" need to affect the (absence of)
> order in receiving the results ..
Maybe the results should be sorted if is requested ..
> - would the search need to be complete?
>
>.. keeping the set of returned data consistent with the search request and the
>contents of the database, after applying appropriate access control,
>size/time limits and so?
Sorry, I don't understand clearly what you want say here ...
>Technically, I don't see any particular criticality in implementing
>something that complies with most of the above requirements, and in
>general I don't see significant obstacles in implementing even fancier
>stuff;
I think as you, you have my help ...
In conclusion, what can I do ? now I can implement a provisional solution but in the future a better solution will be very significant..
Regards, Elier