Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johannes Lantz 85 posts 407 karma points
    17 days ago
    Johannes Lantz
    0

    Hi!

    I am running Umbraco v 8.13. And I am trying to do a Examine search. And when I use Skip/Take to get the paged results. But when I use .Skip(0) it skips 1. I would get a total items count of 8 but I only get 7 "loopable" items. I am really struggling to see why this is happening.. When I remove the .Skip() I get a total items count of 8 and 8 "loopable" items.

    I have tried upgrading the Examine package from 1.1.0 to 1.2.2. But this still occurs.

    Any ideas why this is happening?

    //Johannes

  • Rob 3 posts 72 karma points
    1 week ago
    Rob
    0

    Hi Johannes,

    I'm also experiencing this exact same issue. I'm running Umbraco version 8.15.2 and Examine v1.2.0. I spotted this when I realised what should easily have been the top search result wasn't being returned in my results at all. After spending hours looking at my filter I realised that when I removed the .skip() the result would show up as the top result.

    Rob

  • Johannes Lantz 85 posts 407 karma points
    7 days ago
    Johannes Lantz
    101

    Hi Rob!

    Yea, I also noticed that. I ended up doing something like this:

        // ¯\_(ツ)_/¯
        return pageNumber == 1 ? allResults.Take(pageSize) : allResults.Skip((pageNumber - 1) * pageSize -1).Take(pageSize);
    

    It feels like a really janky solution. But it seems to do the tick..

    //Johannes

Please Sign in or register to post replies

Write your reply to:

Draft