0

The Highlighted Content Web Part built in SharePoint Online allows for us to set a custom query and several sort options below it.

enter image description here

So far that is working for me, but I noticed that none of the bottom sorting options allow us to sort results by their name (i.e. document library titles).

Is there a way we can enforce sorting by name, in either ascending or descending order) within the Query text box?

1 Answer 1

1

Query text in highlighted content web part uses KQL.

I don't think there is any way to enforce sorting within the Query text box.


Workaround:

  1. Go to site collection settings --> Search Schema
  2. Search for managed property which starts with RefinableString
  3. You should be able to get the list pre-created refinable managed properties like RefinableString00, RefinableString01 and so on.
  4. Select a managed property which is not mapped already, and map it to your targeted crawled properties (Title and ows_ListTitle).
  5. Use this managed property in your sorting.

Setup

enter image description here

Output:

enter image description here


Note:

After mapping crawled properties, you may not be able to use the Refinable managed property in highlighted content web part settings.

So either you have to wait for some time till site gets crawled or you can re-index your site.

Re-indexing site:

  1. Go to site settings
  2. Select "Search and Offline Availability"
  3. Click "Reindex site" and wait for some time
4
  • Understood. But what about any alternative approaches to getting to the same goal? according to the documentation we can sort by managed property value??? could that apply in this case? if so...how? Commented Apr 20, 2021 at 14:51
  • 1
    Try this: In the search schema, search for managed property which starts with "RefinableString" you should be able to get the list pre-created refinable managed properties like RefinableString00, RefinableString01 and so on. Select a managed property which is already not mapped, and map it to your crawled property(Title/ListTitle). Use this managed property in your sorting. Commented Apr 20, 2021 at 15:21
  • That worked perfectly thanks! How did you know to use "ref" as a managed property? Commented Apr 21, 2021 at 12:09
  • 1
    In SP online, these "Refinable" properties are available out of the box for each datatype (string, number, date, etc.). So, instead of creating new managed property we can utilize these unused & existing properties for such scenarios. Check this for more information. Commented Apr 21, 2021 at 12:52

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.