[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: the parent of a result.

On 2/22/10 7:37 PM, Mihamina Rakotomandimby wrote:
Manao ahoana, Hello, Bonjour,

I look for the way to search for the parent of the matched target.
FOr example, let's image a forum, with multiple topics

- boys
- girls
- dogs

Each topic has comments (for simplicit let's make them flat)

- boys
  - comment 234
  - comment 65
- girls
  - comment 659
  - comment 4
- dogs
  - comment 351
  - comment 323

Comments ID are unique.
I perform a search:
    ldapsearch (...) commentId=659

The only way to have the parent (girls) is for me to parse the
resulting "dn" of that search, splitting it by ",". Bad&  Dirty.

How (which argument/option) to get the parent of commentId=659?
I don't know which language or API you are using, but if it does not provide a way to manipulate a DN, then you'd better think abot using another one.

You can also search starting from the parent (boys, girls, dogs) using a filter like (commentId=659) and a scope ONE, you will then have the exact DN having this comment, but that means you will do three searches. Not sure that's less ugly :/

Last ugly solution : store the parent's DN in your comment. Yuk...

Ok, then back to the API : find a good one ;)
Misaotra, Thanks, Merci.
de rien :)

Emmanuel Lécharny