From: Evan S. <chi...@gm...> - 2009-10-28 13:46:54
|
Daniel, Thanks, your answer helped me out a lot. It didn't quite work as you had it, but led me in the right direction. I ended up going with: {{#ask: [[{{#ask: [[Category:Pages]]|sort=Rating|order=Descending|format=list|sep={{!}}{{!}}|limit=10|link=none|searchlabel=}}]]|format=ul|order=Ascending}} - Evan On Wed, Oct 28, 2009 at 4:01 AM, Daniel Steiner <st...@fu...>wrote: > Evan > > I’m not sure if it’s working, but I think your query should look like: > > > > {{#ask: [[{{#ask: > [[Category:Pages]]|sort=Rating|order=Descending|format=list|sep={{!}}|limit=10}}]] > |format=ul | order=Ascending }} > > where the inner ask selects the top 10 ratings and presents the result as a > list of 10 pages, separated by a “|” so that the outer ask can select that > pages directly. > > > > Daniel > > > > *Von:* Evan Shaw [mailto:chi...@gm...] > *Gesendet:* Mittwoch, 28. Oktober 2009 01:06 > *An:* jo...@na... > *Cc:* > *Betreff:* Re: [Semediawiki-user] Limiting by one property and sorting > byanother > > > > Joel, > > Thanks for the suggestion, but that doesn't quite do what I want. The > results would only be sorted alphabetically in the event of multiple results > having the same rank. For example, we have the following pages: > > Page A - [[Rating::4]] > Page B - [[Rating::4]] > Page C - [[Rating::5]] > > Now let's say we're limiting the search results to the top 2 pages instead > of 10. The results would be given like this: > > Page C > Page A > (Page B would come next if not for the limit, since it has the same rating > as Page A, but comes after Page A alphabetically.) > > So the pages are sorted first by Rating and then in alphabetical order only > in the case of a tie. I'd prefer the results to be: > > Page A > Page C > > - Evan > > On Tue, Oct 27, 2009 at 6:13 PM, Joel Natividad <joe...@gm...> > wrote: > > Evan, > > You should be able to specify multiple sorting fields, with each field > having its own sorting order. > > > > http://semantic-mediawiki.org/wiki/Help:Inline_queries#Sorting_results > > > > Hope this helps, > > Joel > > > > On Oct 27, 2009, at 5:54 PM, Evan Shaw wrote: > > > > Hi all, > > I have a group of pages, each with a rating. I want to make an inline query > such that I can choose the pages with the 10 highest ratings and have them > displayed in alphabetical order. I can figure out how to get the top 10 > rated pages: > > {{#ask:[[Category:Pages]]|sort=Rating|order=Descending|format=ul|limit=10}} > > But then of course since I'm sorting by Rating, I can't also sort by > alphabetical order. I also tried using a subquery: > > > {{#ask:<q>[[Category:Pages]]|sort=Rating|order=Descending|format=ul|limit=10</q>|sort=|order=Ascending}} > > I was thinking that the subquery would get the top 10 rated pages, and then > those 10 would be sorted alphabetically, but that's not the case. I just get > the first 10 pages in Category:Pages sorted alphabetically, as if there were > no limit on the subquery at all. > > Can anyone help me accomplish this? Is it possible? > > Thanks, > Evan > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > > http://p.sf.net/sfu/devconference_______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > > > > -- > > Joel Natividad > > jo...@na... > > Think<http://web.archive.org/web/20010228171255/www.apple.com/thinkdifferent/> > Different <http://www.youtube.com/watch?v=4oAB83Z1ydE>! > > > > > > > > > |