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?
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?
Solution:
filter = criteria.Field("profileIsPublic", "1").And().OrderBy(new string[] { "lastName" });
is working on a reply...