I was wondering whether it's possible and how one would go about setting up an automatic exclusion of search results? Mmeaning documents which are older than 5 years - having these excluded from the search result.

Maybe adding some sort of refiner aswell where one would get the choice to include those if they so wish? Would this be do-able?

thanks in advance!


You can achieve it through query transform.

  1. Edit the search results web part on the page.
  2. Click change query.
  3. Add this to query field


Or you can go for a dynamic approach


where 1825 is 365*5

Note: If you are using any Result source to display your results then directly add these query transforms to the result source.


If you are not using content search webpart and want to globally limit the search results to show document within the last 5 years, you need to created a new result source or modify your existing result source.

By adding a query transformation in the result source, you can limit the search results to what you want. Refer this link for the detailed steps. The article explains how to limit your results to one document library. You can modify the query to limit it by the Created date of the document.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.