Hello Dennis,

Did you find a solution already? The concerns of Bart certainly have to
be taken into account! I don't think the solution Bart points out below
is a solution, because I suppose the comment document is not *part of*
the article, but a separate document. Anyway, there are some other
options (it probably boils down to 5 separate searches, but the ones you
are talking about will be fast enough)

-Ard

> 
> Arthur Bogaart wrote:
> > Hi Dennis,
> > 
> > AFAIK this is not possible in a DASL query.
> > You can try to mimic this behaviour by doing a dasl without a limit 
> > (or a big limit) and then filtering the unique values with 
> an xsl, or 
> > first doing a dasl on the last 5 news-articles and with the 
> returned 
> > UIDs construct 5 dasls that search for the last 
> corresponding comments 
> > on these news articles.
> Keep in mind that:
> - there is a hard limit of 1000 results in the repository
> - sorting large datasets with xsl can be really slow and cpu intensive
> 
> So maybe you want to tackle this from another angle. For 
> example set a extra property on the article with the date 
> when the last comment was added. That way you can get the 
> five new articles that where last commented with one query.
> 
> Regards,
> Bart
> 
> > 
> > regards,
> > Arthur Bogaart
> > 
> > [EMAIL PROTECTED] - www.onehippo.com
> > -------------------------------------------------------------
> > Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam 
> +31(0)20-5224466 
> > San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
> > 94952-3329 +1 (707) 773-4646
> > -------------------------------------------------------------
> >  
> > 
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED]
> >> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Dennis 
> >> de Boer
> >> Sent: dinsdag 22 april 2008 13:33
> >> To: [email protected]
> >> Subject: [HippoCMS-dev] distinct searches
> >>
> >> Hello everyone,
> >>
> >>  
> >>
> >> Another question I have regards 'distinct' searching using DASL 
> >> queries.
> >>
> >> I have two datatypes, lets call them a news article and a comment.
> >>
> >> The comment datatype has a reference (the UID) to the news article.
> >>
> >>  
> >>
> >> What I try to get from my DASL query is the following:
> >>
> >>  
> >>
> >> Get the 5 latest comments, but with a distinct article UID 
> reference. 
> >> If I get the latest 5 comments, it could happen that they all 
> >> reference the same article, so I want a distinct/ unique article 
> >> reference.
> >>
> >>  
> >>
> >> Is this possible using a DASL query?
> >>
> >>  
> >>
> >> Thanks in advance.
> >>
> >>  
> >>
> >> Dennis de Boer
> >>
> >> ********************************************
> >> Hippocms-dev: Hippo CMS development public mailinglist
> >>
> > ********************************************
> > Hippocms-dev: Hippo CMS development public mailinglist
> 
> 
> -- 
> 
> Hippo
> Oosteinde 11
> 1017WT Amsterdam
> The Netherlands
> Tel  +31 (0)20 5224466
> -------------------------------------------------------------
> [EMAIL PROTECTED] / http://www.hippo.nl
> -------------------------------------------------------------
> ********************************************
> Hippocms-dev: Hippo CMS development public mailinglist
> 
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to