Paging through tampered results non sequentially

41 views
Skip to first unread message

Stan A

unread,
Apr 28, 2013, 3:09:55 AM4/28/13
to rav...@googlegroups.com
Sorry if this has been answered somewhere else, but I can't find it if it has. 

How do I write my code so that I can page non sequentially though tampered results?  e.g. if there are 5 pages of results, how do I get let a user accurately jump to page 4 or go to the previous page when there are skipped results?  If there are no skipped results this is very straight forward. I was reading the Paging section of the documentation (http://ravendb.net/docs/2.0/client-api/querying/paging) but it only shows how to go to the next page.

I have an index like the following:

            Map = products => from item in products
                              from category in item.Category
                              select new { item.Name, categoryName = category.Name }

Also the count of actual unique documents is wrong for this scenario when using TotalResults.  If I have 10 products 5 with two categories I get 15 results.  What is the best way to get the accurate count for the TotalResults?  I could use TotalResults - SkippedResults, but if I have a page size of 5 and all my skipped results are on page 2, then the TotalResults value is 15 and the SkippedResults value is 0 so that method wouldn't work until I get to page 2. This is also why my paging doesn't work accurately. 

Oren Eini (Ayende Rahien)

unread,
Apr 28, 2013, 3:31:38 AM4/28/13
to rav...@googlegroups.com
In 2.0, do nothing, it works.
--
You received this message because you are subscribed to the Google Groups "ravendb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nikola

unread,
Mar 26, 2015, 8:45:28 AM3/26/15
to rav...@googlegroups.com
Oren hi,

Can you direct me how to do exact same thing in 3.0 version of RavenDB.

Are there any examples online?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Mar 26, 2015, 8:54:08 AM3/26/15
to ravendb
You don't have to do anything, it just works.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kijana Woodard

unread,
Mar 26, 2015, 1:20:07 PM3/26/15
to rav...@googlegroups.com
To add on, I'm not sure why the OP had a "fan out query" instead of:

            Map = products => from item in products
                              select new { item.Name, item.Categories }

Chris Marisic

unread,
Mar 27, 2015, 11:26:32 AM3/27/15
to rav...@googlegroups.com
I think that was the confusion of OP. Paging a fan out index with document results may be unexpected what actually occurs.

The only reason to page a fan out index is when reading the index results itself and not getting the full documents back.
Reply all
Reply to author
Forward
0 new messages