Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Can anyone help me with SharePoint 2010 KeywordQuery problem? I have the following code to search user profile and sort results by managed property.

            var keywordQuery = new KeywordQuery(site)
                QueryText = "",
                KeywordInclusion = KeywordInclusion.AllKeywords,
                HiddenConstraints = "scope:" + "\"People\"",
                ResultTypes = ResultType.RelevantResults,
                RankingModelId = "D9BFB1A1-9036-4627-83B2-BBD9983AC8A1"

            keywordQuery.EnablePhonetic = true;
            keywordQuery.EnableNicknames = true;
            keywordQuery.ResultsProvider = SearchProvider.SharepointSearch;

            keywordQuery.SortList.Add("WorkEmail", SortDirection.Ascending);


            ResultTableCollection resultTableCol = keywordQuery.Execute();
            ResultTable resultTable = resultTableCol[ResultType.RelevantResults];

When I use WorkEmail as the property to sort by everithing is working as I expect. But when I replace WorkEmail with say JobTitle sorting does not work. It works as if sort list passed to KeywordQuery is empty. My view is that something wrong with managed properties metadata. MaxCharactersInPropertyStoreIndex = 64 for both mentioned properties

share|improve this question

1 Answer 1

Bit of a delayed reply on this but this might help someone else - even with SharePoint 2013.

If you recently changed the MaxCharactersInPropertyStoreIndex property of a managed property you'll most likely have to do a full crawl of the content source before it will take effect and be sortable.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.