Skip to content

[BUG] Submit-PnPSearchQuery returns inconsistent data #4730

Open
@AsierAndres

Description

@AsierAndres

Reporting an Issue

I've tried running the same query once and again with Submit-PnPSearchQuery, and the number of results returned by the command varies from 400 on the worst cases to 56.000 when I'm lucky. The amount of items at my tenant that meet the query criteria has always been around the aforementioned 56.000 items. So, the amount of results of the query should have always been around that number.

Expected behavior

The Submit-PnPSearchQuery command should always return the same amount of results if there are no changes on the items that meet the search criteria.

Actual behavior

Every time I run the Submit-PnPSearchQuery comand I receive a different amount of result with no logic at all. I sometimes receive 400 items, run the same query again and receive 56.000, and after a couple minutes it returns 30.000 results.

Steps to reproduce behavior

I've tried it with different app registrations, on different computers and in different days, but the behavior is always the same.

Connect-PnPOnline -Url $adminCenterURL -ClientID $client -CertificateBase64Encoded $cert -Tenant $tenant

$sites = Submit-PnPSearchQuery -Query "RefinableString80:Yes" -All -TrimDuplicates $False

Write-host "Sites retrieved: $($sites.ResultRows.count)"

What is the version of the Cmdlet module you are running?

2.12.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions