Copied to clipboard

Flag this post as spam?

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


  • Filip Axbrink Jönsson 3 posts 73 karma points
    Jun 12, 2019 @ 09:31
    Filip Axbrink Jönsson
    0

    ContentQuery Search returns wrong amount of records

    Hello,

    I'm building a search page and I can't seem to get the right amount of results from using Umbraco.ContentQuery.Search with skip and take. I'm not sure if I'm doing something wrong or if it's a bug with the method.

    To give you some examples:

    var result = Umbraco.ContentQuery.Search(searchQuery, 0, 10, out long totalRecords, string.Empty);
    

    Yields totalRecords: 191, result.Count(): 8

    var result = Umbraco.ContentQuery.Search(searchQuery, 5, 10, out long totalRecords, string.Empty);
    

    Yields totalRecords: 191, result.Count(): 12 and doesn't skip any results

    var result = Umbraco.ContentQuery.Search(searchQuery, 0, 15, out long totalRecords, string.Empty);
    

    Yields totalRecords: 191, result.Count(): 12

    var result = Umbraco.ContentQuery.Search(searchQuery, 5, 15, out long totalRecords, string.Empty);
    

    Yields totalRecords: 191, result.Count(): 16 and doesn't skip any results

Please Sign in or register to post replies

Write your reply to:

Draft