Closed spverma03 closed 2 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi @spverma03 - thank you for reporting this one. I don't think I have any environment to test with more than 500 sites, so I will need your help here.
Could you please check how many _api/search/query
requests you see in the Network when opening the site picker?
Could you also send me screenshots or results for PrimaryResults.RelevantResults.TotalRows from these request(s)?
Thanks!
Hi @AJIXuMuK - Thank you for your prompt reply. I cannot share exact data due to data protection policies of my client. Following are details that maybe useful for you to triage:
API: Tenant URL/sites/mysite/_api/search/query?querytext=%27contentclass:STS_Site%20Path:
Query String Parameters: querytext: 'contentclass:STS_Site Path:*tenant url' selectproperties: 'SiteId,SiteID,WebId,DepartmentId,Title,Path' rowlimit: 500 startrow: 0
@AJIXuMuK ,
I tried modifying the definition to increase the row limit by changing code inside node-modules but it didn't worked. The SitePicker kept on loading. I could see continuous search query being made in the network tab of browser.
As I'm looking for a quick solution currently, may you think of some work-arounds for time being until the resolution is pushed to repo:
Suggest if I can modify query in node-modules in current implementation as a quick-fix, if possible.
I have also observed that this issue is more prominent when I open a previously populated SitePicker instead of adding a new one. I see some more sites missing in edit mode.
Hi @spverma03,
node_modules
. And it would be a good enhancement in future.I'll try to repro it.
@spverma03 I decreased rowLimit
locally to 5 to repro the issue. But it behaves correctly.
When you're saying you see continuous search requests in network tab - what is the startrow
in these requests? Is it changing?
In my case I see like that:
@AJIXuMuK , I further investigated this it seems to be something related to search excluding some sites as duplicates. Most of the sites in our tenant are created using a template and some has similar kind of data.
I tried testing this out using search query tool and figured out that when I add parameter trimduplicates=false, all my sites come up.
The problem is, if I try to add this parameter in SPSitesServices.js file, the site picker goes into endless loop. I can see network tab making continuous search queries. In fact any change made directly to this file results in endless search queries being fired in loop. I may be breaking something by manipulating this file directly.
Do you have any suggestions? Thank you in advance
@spverma03 - I have changed the query to be POST and added support for trimDuplicates
and additionalQuery
.
You can try these new features in beta version and check if it works.
@AJIXuMuK - Thank you for your prompt assistance. I tried the beta version and it is working for me. Eagerly waiting for the stable release (3.4.0). We are not allowed to use beta versions in client/production.
Do you have any expected timeline for version 3.4.0 roll-out?
Again, thank you promptly addressing this issue. It will help the community.
@spverma03 - we're planning to release a new version in the next couple of days
@AJIXuMuK - Thank you for the update.
Meanwhile I observed similar issue in @pnp/spfx-property-controls where the OOB shows 5 search results by default and has option of Show More. In case of PropertyFieldSitePicker control there are only 5 search results (Can we make this configurable at least or have a show more CTA). Unlike OOB control, we cannot search by URL (Good to have search by URL feature). Due to this, the control sometimes do not show the searched site in the options.
For example, in my case there are many sites having keyword 'Home' in the site title such as various department home sites, teams home sites etc. There is also one landing site whose title is just 'Home'. When I search for keyword 'Home' I get random 3 search results but I do not find any option to search for the landing home site. In OOB webpart I can see the 'Home' site in default 5 search results, also I can search for the site using exact URL.
Can we also implement remove duplicate search query changes in this control as well?
Any suggestions?
Category
[ ] Enhancement
[x] Bug
[x] Question
We are observing that not all sites are fetched by PnP Site Picker Control. It seems 500 items are getting fetched on load of control. There are more sites in the tenant. When user types, the intended result is not shown as it was not fetched initially. New call for data do not trigged as we type the search-keyword.
This is certainly a bug.
Reference: https://pnp.github.io/sp-dev-fx-controls-react/controls/SitePicker/
<SitePicker context={this.props.context} label={'Select sites'} mode={'site'} allowSearch={true} multiSelect={false} onChange={(sites) => { console.log(sites); }} placeholder={'Select sites'} searchPlaceholder={'Filter sites'} />