Copied to clipboard

Flag this post as spam?

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


  • Barry Fogarty 493 posts 1129 karma points
    Aug 17, 2011 @ 13:52
    Barry Fogarty
    0

    Examine OrderBy() extension method not found

    I am using an examin index for searching members and I am trying to set it up so I can sort on a custom property (lastName).

    @using Examine;
    @using UmbracoExamine;

    @{
        var searchTerm = Request.QueryString["q"];                          //Get the search term from query string
       
        var criteria = ExamineManager.Instance
                .SearchProviderCollection["MyMemberSearcher"]
                .CreateSearchCriteria(UmbracoExamine.IndexTypes.Member);

        var filter = criteria.Field("profileIsPublic", "1").OrderBy(new string[] { "lastName" });
    }

    I am getting an error that states:

    'Examine.SearchCriteria.IBooleanOperation' does not contain a definition for 'OrderBy' and no extension method 'OrderBy' accepting a first argument of type 'Examine.SearchCriteria.IBooleanOperation' could be found.

    I have checked my Examine DLL and it indeed has the OrderBy() extension method in the IQuery public interface.  (same location as the Field() ext method which I am using in my filter too).  I have even downloaded the latest DLLs from Examine on codeplex but I havent been able to get past this issue.  Any ideas?

  • Barry Fogarty 493 posts 1129 karma points
    Aug 17, 2011 @ 14:04
    Barry Fogarty
    0

    Solution:

    filter = criteria.Field("profileIsPublic", "1").And().OrderBy(new string[] { "lastName" });

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies