Introduction :
Hello everybody. Today i got another problem with the Search Results Web Part.
I wanted to sort results. I went on “Sorting” tab and choose to sort by one of my own properties.
When i test the query with the simulator it is working fine. But when i apply modifications and went back to the page i see results sorted on creation date!
Problem :
After spending hours searching on Internet, i found many blogs talking about the same issue. It seems that it is a bug with the Search Results Web Part.
The only solution that they suggest is to create a new result source and make sorting on it.
I did not like that solution so i decided to inspect again the xml of the Web Part.
Solution :
I found the property “AvailableSortsJson”
As its name indicates, this property specifies the available sorts. I put my property on first rank :
[{“name”:”Display Name of your sort”,”sorts”:[{“p”:”Name of property”,”d”:1 for descending/0 for ascending}]}]
And now everything is working fine.
I spent all day trying figure it out whats wrong. It helps a lot thank you Mr Salhi
Glad to hear that.. I am still available if you need any help