unless you modify the \Views\MacroPartials\ezSearch.cshtml source for example code line:
var searchResults = model.PagedResults.OrderByDescending(r => r.Fields["sortOrderMain"]);
But the serachresults are inconsistently I have a searchresult in childpages in 4 different mothernodes but they do not sort accordingly to all 4 of the results. They sort in pair 2 and 2 but all 4 items are not sorted correct :(
here is somebodyelse with the same problem sorting out of order:
adjusting the sort order?
Nice job. This one runs very well on old templates in umbraco 6 not just the MVC templates
I have one question: How do you adjust the sort order of the items presented in the search results? I want to sort after a custom set parameter
I did find out how to set the sorting of search results:
the order you define your searchfiels is the sorting you'll get
searchFields="nodeName, sortOrderMain, metaTitle, metaDescription, metaKeywords, bodyText, description, productName, buzzWord"
unless you modify the \Views\MacroPartials\ezSearch.cshtml source for example code line:
var searchResults = model.PagedResults.OrderByDescending(r => r.Fields["sortOrderMain"]);
But the serachresults are inconsistently I have a searchresult in childpages in 4 different mothernodes but they do not sort accordingly to all 4 of the results. They sort in pair 2 and 2 but all 4 items are not sorted correct :(
here is somebodyelse with the same problem sorting out of order:
http://our.umbraco.org/forum/developers/api-questions/38846-Definitive-way-to-Sort-Examine-Search-Results
anybody got a clue?
What I want to do with sorting is very much the same as ranking content. This code in the file ezSearch.cshtml does some ranking so it says
// Rank content based on positon of search terms in fields
for (var i = 0; i < model.SearchFields.Count; i++)
{
foreach (var term in model.SearchTerms)
{
query.AppendFormat("{0}:{1}*^{2} ", model.SearchFields[i], term, model.SearchFields.Count - i);
}
}
but I dont grasp the way this code is doing the ranking. Can anyone explain how the ranking is done there?
is working on a reply...