I'm with Ryan here. Don't quite understand what you mean Ayende?
How do we get raven to precompute the ranks and store them in the
index so we can query on them?
On Oct 13, 11:54 am, Ryan Heath <
ryan.q.he...@gmail.com> wrote:
> Hmm, let me see if we're on the same level ...
>
> Querying top X is simple.
> But Jack is at 27, how would you get that number 27?
>
> // Ryan
>
>
>
> On Thu, Oct 13, 2011 at 11:29 AM, Ayende Rahien <
aye...@ayende.com> wrote:
> > You don't need to know the rank, all you need to know is the user name and
> > whatever or not he is in the top X
>
> > On Thu, Oct 13, 2011 at 11:27 AM, Ryan Heath <
ryan.q.he...@gmail.com> wrote:
>
> >> That implies that you know the ranks before hand.
> >> What if I only had <user,sales>. How would we get the rank based on sales?
>
> >> // Ryan
>
> >> On Thu, Oct 13, 2011 at 11:06 AM, Ayende Rahien <
aye...@ayende.com> wrote:
> >> > The problem is that what you want is actually to different things.
> >> > There is the ranking, and there is whatever a user is in the top X
> >> > It is easy to get either.
> >> > You get the ranking by just saying something like:
> >> > session.Query<...>().OrderByDescending(x=>x.Ranking)
> >> > And you can get whatever a user is in the top X using:
> >> > var item = session.Query<...>().Where(x=>x.User = user).single();
> >> > var xPos = session.Query.Skip(X-1).Take(1).Single();
> >> > return x.Pos.Ranking - item.Ranking;
> >> > On Thu, Oct 13, 2011 at 11:02 AM, Ryan Heath <
ryan.q.he...@gmail.com>
> >> > wrote:
>
> >> >> Querying for 'Jack' would not return its rank at 27 ...
>
> >> >> What I would like to see is
> >> >> that Raven could generate those rankings for me base on which field(s)
> >> >> I would sort.
>
> >> >> Maybe when indexing store the rank (rownumber) with the doc?
>
> >> >> // Ryan
>
> >> >> On Thu, Oct 13, 2011 at 10:31 AM, Ayende Rahien <
aye...@ayende.com>
> >> >> wrote:
> >> >> > You would need to load the first five baesed on the rank and check
>
> >> >> > On Wednesday, October 12, 2011, nabils
> >> >> > <
alt%shuhaiber....@gtempaccount.com>
> >> >> > wrote:
> >> >> >> Any ideas we can perform a rank query using a map reduce such as the
> >> >> >> one below where we always want to know Jacks position whether he is
> >> >> >> in
> >> >> >> top 5 or not?
>
> >> >> >> Top 5 Sales People in 2010
>
> >> >> >> 1) Fred 10m
> >> >> >> 2) Joe 8m
> >> >> >> 3) Michael 6m
> >> >> >> 4) Bob 5m
> >> >> >> 5) Peter 2m
> >> >> >> -------------
> >> >> >> 27) Jack 110k
>
> >> >> >> Thanks,
> >> >> >> Nabil- Hide quoted text -
>
> - Show quoted text -