Appreciate any customization on subsite search hiding from global search. I am using Search API and hence I can exclude the subsite indexing and crawling
SharePoint 2013 Custom Search
Hello, I have a subsite document library having 5000 documents. I also have a SP webpart(server control) to display custom result based on custom parameters.
The documents were also displayed in the global search. I was asked to not to show documents in global search. I defined the rule to exclude the library for the document library but the documents are not returning results even within my application. It looks like SP search requires crawling content in order to display results even with object model. Having said that how do I block showing these content from the Global search?
Please advise.
3 answers
Sort by: Most helpful
-
-
Amos Wu-MSFT 4,051 Reputation points
2021-03-02T09:01:28.237+00:00 You could try to custom SharePoint 2013 search template. There is a
ctx.CurrentItem.Path
property in the search template. You could compare the current site url with the value ofctx.CurrentItem.Path
to decide whether to display the current item.
Steps To Create Custom Display Templates In SharePoint 2013
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. -
Shri-6058 326 Reputation points
2021-03-17T05:28:45.907+00:00 Thank you for the follow up. I am only concerned on using custom search in main SharePoint 2013 Global search using custom template. If it is only for subsite or any site collection.
Do you suggest to modify the _layouts schema file? how to edit ctx.CurrentItem.Path ?
I am still working on solutions. My SP 2013 on-premises search shows results in the search result page even when user doesnt have permission. I am trying to find if there are any hotfix or known issue. My plan was to remove everybody's permission from the document library, so the result wont appear except site collection administrators. I tried to develop my custom application to call and return search results using impersinating/administrator access. I am stuck at what SharePoint search result strange behavior. Please let me know if you have any suggestions