3

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

7

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.

  • 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 May 12 '14 at 15:12
  • I am not clear on what you are asking. – Matthew McDermott May 12 '14 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 May 14 '14 at 9:41
  • 3
    You do that with the Search Settings page. – Matthew McDermott May 14 '14 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
    That's what I said in my answer. – Matthew McDermott May 14 '14 at 12:30
  • Thank you Matthew, I just write it more in detail and a printscreen.. – Ola May 20 '14 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" :-) – BlueSky2010 Feb 9 '16 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, privacy policy and cookie policy

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