Smart search filter sort

Iman Emran asked on December 2, 2017 13:37


I want to sort product search results for example by their price and based on items which are in stock first and after them, show out of stock items.

In stock status is related to the SKUEnabled and SKUAvailableItems .

How should I write the correct filter values?

I wrote this but it doesn't get proper results sort:

SKUAvailableItems DESC, SKUName;;Product name
SKUAvailableItems DESC, SKUPrice;;Price ascending
SKUAvailableItems DESC, SKUPrice Desc;;Price descending

Recent Answers

David te Kloese answered on December 3, 2017 23:13

Hi Iman,

What type of search are you using? Any specific analyzer type?

  • could you check if the field "SKUAvailableItems" is marked Searchable.

Find info on what these types do in the documentation.

Image Text

You're using it in a custom filter Web Part I assume, does it work when you put it directly on the search results Web Part?

0 votesVote for this answer Mark as a Correct answer

Iman Emran answered on December 4, 2017 20:22

Hi David,

I use Pages index type and the field "SKUAvailableItems" is marked Searchable.

I use default Smart search filter web part.

My problem is that I can not sort search result according to the products which are in stock first.

Also my products have variants and always I show the first variant of the product in the search result so I have problem to sort them based on their prices and in stock status.

Thanks a lot

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.