Sorting does not Work in the Search Results Web Part in SharePoint 2013

That's very strange, defining the sorting criteria in the search result web part does not seems work. 
I had configured the search query in the Query Builder of the Search Web Part to retrieve the documents or Everything (which is very easy with the query builder). Underneath the sorting tab, I configured it to sort by the creation date.
Here you can see the sorting configuration:


ViewLifeTime Property :- Its give more hit item on the top, if we defined this property in descending order.

Solution Approach:-

Create one more result with replica of same (reason of replica - whatever we are going to define in that result source might not require in other place where we are going to use same result source)

Configuring the sorting in the web part settings did not work, so the next thing I tried was to create a result source with the same query. Creating a result source can be done on the Site Collection itself, so you do not need to go to Central Administration.
Step 1:
Go to Site Setting and select Manage result source under Site Collection Administration section. Click Edit.

 Step 2:
Select Launch Query Builder
Step 3:
Select sorting tab under Build your query section.
Select the sorting criteria whatever you want there and save  it.


After the creation of the result source and sort criteria just configured the search results query builder and specified my result source as the query that needs to be used.
This approach works perfectly, the result source does the sorting, instead of the search results web part.

No comments:

Post a Comment