Ordering articles and documents in search results using XRANK and Query Rules


  • I have a SPO intranet portal and the requirement is to have search results ordered like this: Articles (in Pages library) that have the keyword in their title should display first, followed by those having keyword in their content (body) and all other documents (docx, pptx, pdf, etc.) should come in last, after the articles. Can anyone help, how this ordering can be done using XRANK expression and/or query rules?

    Thanks in advance...

    • Edited by Farhan82 Wednesday, March 15, 2017 1:42 AM
    Wednesday, March 15, 2017 12:59 AM

All replies

  • Hi Farhan82,

    We can add dynamic ordering rule to show most relevant data on top.

    1. Edit the page, and edit the Search Results web part.

    2. Change the query.

    3. Under Sorting tab, select Add dynamic ordering rule from the Dynamic ordering section.

    Here is an article about how to change the order in which search results are display:

    Best regards,

    Linda Zhang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Thursday, March 16, 2017 9:30 AM
  • Thanks Linda, I have tried the approach described in that article, it only solves part of the problem i.e. promoting articles on the top. I also need an ordering within the articles themselves - those having keyword in the title should display on top of those articles that have it in their content (body). Is it possible to have XRank expressions in query text similar to what you described in this thread for my scenario? If not, then can you suggest other ways to meet the requirement.
    Thursday, March 16, 2017 10:46 AM