Search Results web-part is not showing all the related sub-sites, it is showing only 4 sub-sites out of 9 sub-sites
-
30-12-2020 - |
题
I am working on a sharepoint on-premises farm 2013, and i am using Search Result web-part to return all the sub-sites which are under a parent site collection, so i define the following criteria, inside the Search Results web part:-
contentclass:STS_Web
Path:http://******/businessfunctions/
The search criteria should mainly return all the sub-sites which contain the parent site collection path http://******/businessfunctions/
inside its path.
now as shown in the above picture the Search Result web part only return 4 sub-sites, while the site collection contain 9 sub-sites, as follow:-
now i test this on another farm which contain around 40 sub-sites and the Search Result was able to retrieve only 9 sub-sites.. now currently i am running the web part using the system account username, so i can view,edit every thing, so the problem i am facing is not a permission issue . so what could be causing this problem? so the Search Result web-part does not show all the intended sites?
Edit. now under the web-part setting there is an option to show duplicates, and when i set the web-part to show duplicates i got all the related sub-sites.. so not sure why the web-part is assuming that the sub-sites are duplicates, although each sub-site has its own URL and title.. but those sub-sites where created using a custom site template !! So could this be the issue, that the web-part is dealing with all the sub-sites which have been created using a custom site template as duplicates ?? seems weird??
解决方案
Just as you stated in your edited question, there seem to be some issue as SharePoints misstaken sites using the same custom template as duplicates and hides them from your querys result.
The author of this blog post had the same problem as you did and mention that the solution is/were to modify the TrimDuplicates
property.
SharePoint Online Search Results Duplicates "Trap"
- Export the Search Results Web Part from your page.
- Open the .webpart file in your favorite editor.
- Search for “Trim Duplicates”, you will find it as part of the DataProviderJSON property.
- Set the "TrimDuplicates" property to False.
- Upload the web part.
- Add the web part to your page.
Search is not returning all STS_Web
If you would like to dig deeper, I think that you could use PowerShell to get the properties from either the sites created using the custom template, or the template itself and see if you find any duplicate ID's or something like that.