SOLVED

Change default link to search in SharePoint online

Copper Contributor

When we input the keyword in this Search box in SharePoint online,

arine1901_0-1704792136226.png

the default link that launched is like this : 

https://domain-name.sharepoint.com/sites/site-name/_layouts/15/search.aspx/siteall?q=test

How can I change the default link from 'siteall' to 'sitenews' when launching the search in SharePoint online?
https://domain-name.sharepoint.com/sites/site-name/_layouts/15/search.aspx/sitenews?q=test 

Thank you

 

4 Replies

Hello @arine1901 

 

i think it's not possible to change the the default scope from the Microsoft Search Box on top. You can only define the scope or redirect to an custom search page. In the custom search page, you can define the default scope.

 

Here are the possibilities of the current search box: https://learn.microsoft.com/en-us/microsoftsearch/manage-spo-search-box?WT.mc_id=DX-MVP-5004845https...

 

And here are more information about custom search with PnP Modern Search Web Parts: https://microsoft-search.github.io/pnp-modern-search/

 

Best, Dave

I agree with David, I don't think you can change this but you can add new verticals and also the results layout. I guess your second example is after clicking on the News vertical.

@David Mehr If we disable the status of the "All" tab, it will give error response because of the default link that launch first.

arine1901_1-1704852648636.png

 

So, we have to always enable the "All" tab.

 

Now, I try to add a query for filtering the result only give the news post type. 
What is the right ContentClass of the news?

Path:https://domain-name.sharepoint.com/sites/site-name IsDocument:1 FileExtension:aspx ContentClass:

is the query correct?

 

Thank you

best response confirmed by David Mehr (MVP)
Solution

Hello @arine1901

 

news posts are pages, there are saved in SitePages. But news posts have a promoted state 1 or 2, you can filter this property in your query. You can find more informations in this blog from @Gregory Zelfond : https://sharepointmaven.com/news-post-page-vs-sharepoint-page-in-sharepoint-online/ 

 

Example: 

{searchTerms} contentclass:STS_ListItem_WebPageLibrary AND RefinableString104:2

 

contentclass:STS_ListItem_WebPageLibrary >> only webpage libraries

RefinableString104:2 >> I have mapped ows_promotedstate to the RefinableString104

DavidMehr_0-1704958278398.png

 

For sure, you can add more properties like PATH in your query.

 

Hope this helps.

 

Best, Dave

1 best response

Accepted Solutions
best response confirmed by David Mehr (MVP)
Solution

Hello @arine1901

 

news posts are pages, there are saved in SitePages. But news posts have a promoted state 1 or 2, you can filter this property in your query. You can find more informations in this blog from @Gregory Zelfond : https://sharepointmaven.com/news-post-page-vs-sharepoint-page-in-sharepoint-online/ 

 

Example: 

{searchTerms} contentclass:STS_ListItem_WebPageLibrary AND RefinableString104:2

 

contentclass:STS_ListItem_WebPageLibrary >> only webpage libraries

RefinableString104:2 >> I have mapped ows_promotedstate to the RefinableString104

DavidMehr_0-1704958278398.png

 

For sure, you can add more properties like PATH in your query.

 

Hope this helps.

 

Best, Dave

View solution in original post