Forum Discussion
SPFx react-search-refiners webpart | No results from teamsites displayed
I'm using the SPFx SPFx react-search-refiners webpart and I don't know if this is a bug or this is due to SharePoint restrictions.
When I enter a KQL query I supose to get the same results as I use the query in the search box or in the SharePoint Search Query Tool.
I have a hub site (SharePoint Communication Site) with several group connected Teamsites connected to this hub site. When I enter the following query
Path:https://tenant.sharepoint.com/teams/* contentclass:STS_Site SiteTemplate:GROUP
in the Query Template box no results are returned.
But when I enter this same query in i.e. the SharePoint Searchbox I get a list of the teamsites back.
And when I add this same query in the SharePoint Search Query tool I also get the right results back.
Some Teamsites are private and some are public, and I'm Owner of all sites.
Steps to Reproduce:
- Create new Communication Site
- Make this site a hub site
- Create several teamsites
- Connect them to the hubsites
- Add the webpart to the startpage of the hub
- Configure webpart:
- Search Query Keywords = *
- Query Template =
Path:https://tenant.sharepoint.com/teams/* contentclass:STS_Site SiteTemplate:GROUP - No further Changes
Is this a bug or is this due to SharePoint restrictions?
- Matti PaukkonenIron Contributor
Are Groups you are searching for set as "Private"? By default Search REST API is not including Private Groups on search results.
Web Part is not including EnableDynamicGroups property on search query. So it is not a bug, it's just feature missing.
- Michèl DingsCopper Contributor
Thanks for the information. I'm will check the EnableDynamicGroups property.
- Michèl DingsCopper Contributor
I added the following lines of code to the SearchServices.ts file:
searchQuery.Properties = [{Name: "EnableDynamicGroups",Value: {BoolVal: true,QueryPropertyValueTypeIndex: 3}}]And it is working now. Thanks Matti Paukkonen for pointing me in the right direction.