How to resolve error while using ORDER BY clause in search query in SharePoint search

In SharePoint, searching a content, a file is very easy. But before performing search you need to do some settings in Search Services. The default search result will come without any setting, just you have to run the crawler. But to enhance your search result you need to made changes in metadata property.

Hi all,

This article will help you to get the search result from SharePoint if you are using ORDER BY in your query.

Generally creating a search site in SharePoint is quite easy. You can search default values from scope.


SELECT Title, SiteName, Path FROM Scope()

In this condition you will get result correctly.

But think about below query:

SELECT Rank,Title,CreatedBy, Path,Size,FROM SCOPE() ORDER BY Title

In this condition you will get blank result. Means ORDER BY will not work here.

Suppose you want to enhance your search result. For ex. if you want to get result in sorted order by a specific column, In this condition you will not get your search result. For this you need to made small change in meta data property.

To get the result by using ORDER BY clause in your query do the below steps:

Central Administration --> Search Service Application --> Metadata Properties --> Select your Meta Data Property->Edit Managed Property.
Now please tick the option, "Reduce storage requirements for text properties by using a hash for comparison".

After this perform the query by using ORDER BY clause and see the result.


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: