Copied to clipboard

Flag this post as spam?

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


  • Steven Shiells 5 posts 25 karma points
    Apr 11, 2012 @ 18:26
    Steven Shiells
    0

    Search results count can be incorrect when using multiple blogs

    If you are running multiple blogs under the one umbraco instance the search results count includes results from other blogs.

    This is easy to fix but causes an issue with the pagination.

    For example.

    I have two blogs, 5 posts in blog 1 contain the search term, and 4 posts in blog 2 contain the search term.

    The number of results that are printed is "9 results:" when infact there should only be 5 (assuming the search is initiated from blog 1)

    if (where count = 5)

    PostService.Instance.GetPosts(Model.IdtagcategoryauthorsearchTermcommenterpage 1, count);

    returns 4 posts from blog 1 and 1 post from blog 2 then only the 4 posts from blog 1 are displayed. However, as there only 5 results in blog 1 there is no link to page 2 as there are only 5 items, leaving 4 posts printed on page 1 and a post on page 2 with no link to it.

    It may be possible to use PostService.Instance.GetPosts to only return results under a blog (e.g. by passing in a blog landing page id instead of Model.Id) but I can't find any documentation on this method so I have no idea what it can do.

    It would also be nice if PostService.Instance.GetPosts returned results ordered by post date (this doesn't happen for me locally but I know it does for other people...) but this is a separate issue.

    (I have no idea if  PostService.Instance.GetPosts has anything to do with this package, just hoping for some pointers to the documentation or something :-) )

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Apr 12, 2012 @ 22:31
    Anthony Dang
    0

    Thanks for the bug report about the count.

    The search results order is an oversight on my part. Normal getting of posts IS ordered by date, however, search results are a mashing of ordered getting, and lucene results.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft