4

I am using SharePoint 2013. There is an OOTB search functianality. When you search on some keyword in the search textbox you are redirecting to:

https://myCompany.com/_layouts/15/osssearchresults.aspx

Is it possible to change the search query on this page? I would like to add some extra filter on ContentType.

I have already did this on my manual created search result page. But now I would like to that in the OOTB search result page osssearchresults.aspx.

This is what I mean with the search box on my homepage. Can I redirect it to my custom search result page?

enter image description here

3 Answers 3

8

This page is not intended to be changed. It is a system page, changing it would change the query for everyone in every site collection. The best practice it to avoid it all together by routing your queries to the Search Center. You can do this through the site collection Search settings.

4
  • What about to remove the search input type on my masterpage and create my own which is redirected to my custom search result page?
    – Ola
    Commented May 12, 2014 at 15:12
  • I am not clear on what you are asking. Commented May 12, 2014 at 15:20
  • I mean there is a search box in the right upper area of the masterpage. You can enter there some search keyword and press on enter. Now you are redirected to the page "osssearchresults.aspx". I would like to redirect it to my custom search result page.
    – Ola
    Commented May 14, 2014 at 9:41
  • 4
    You do that with the Search Settings page. Commented May 14, 2014 at 12:29
5

Go to Site Settings -> Search Settings (on site collection level or site level). There you can enter the center search URL on 2 places, see also printscreen:

/Paginas/MyCustomSearchResultsPage.aspx

enter image description here

3
  • 3
    That's what I said in my answer. Commented May 14, 2014 at 12:30
  • Thank you Matthew, I just write it more in detail and a printscreen..
    – Ola
    Commented May 20, 2014 at 6:55
  • 3
    @Ola Thanks Ola for elaborating Matt's answer! It would have beem fair if you not included "I found the solution myself" :-) Commented Feb 9, 2016 at 19:11
2

You can actually change the query for osssearchresults.aspx. If you create a new result source on your site collection, apply some filter to it and mark it to be the default result source, then this will be used.

But you should note that this will also impact searches in document libraries. So if you create a result source which filters away say word documents, then those won't show in library searches either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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