1

i see a function orderBy but i don't understand how it works and if it's the correct solution.

i'd like know the way to sort the results from querymanager or maybe do this in kql?

and then are there a managed property in sharepoint 2010 to have the uniqueid?

For information i use this to solve my issue

// get the query and settings service proxy
                SearchQueryAndSiteSettingsServiceProxy settingsProxy = SPFarm.Local.ServiceProxies.GetValue<SearchQueryAndSiteSettingsServiceProxy>();
                // get the search service application proxy by name
                SearchServiceApplicationProxy searchProxy = settingsProxy.ApplicationProxies.GetValue<SearchServiceApplicationProxy>("Search Service Application");

                KeywordQuery kquery = new KeywordQuery(searchProxy);
                kquery.IgnoreAllNoiseQuery = false;
                kquery.ResultsProvider = SearchProvider.Default;
                kquery.RowsPerPage = Convert.ToInt32(itemPerPage);
                kquery.RowLimit = Convert.ToInt32(itemPerPage);
                kquery.StartRow = (currentPage * Convert.ToInt32(itemPerPage)) + 1;
                string[] cols = queryCol.Split(';');
                foreach (string c in cols)
                {
                    kquery.SelectProperties.Add(c);
                }
                kquery.QueryText = strKey.Trim();
                int ce = kquery.SortList.Count;
                switch (dir.ToLower())
                {
                    case "ascending":
                        kquery.SortList.Add(colSort, Microsoft.Office.Server.Search.Query.SortDirection.Ascending);
                        break;
                    case "descending":
                        kquery.SortList.Add(colSort, Microsoft.Office.Server.Search.Query.SortDirection.Descending);
                        break;
                }

thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.