Skip to content

Search API returns 2 items while TotalRows is greater #8648

@notariorob

Description

@notariorob

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Describe the bug / error

I'm performing a search using the following:
_api/search/query?querytext=%27benedict%27&querytemplate=%27{searchterms}%20AND%20PECVStatus:3%27
In this case, I know the querytext is part of a searchable managed property & PECVStatus is a queryable managed property. The query returns 2 results (rowCount), while stating there are a number of TotalRows of 6. If I search for other names that I know should also be found I have the same behaviour (2 results while more available).
image

It happens for some other querytexts even when not providing a querytemplate, but only some:
_api/search/query?querytext=%27Chris%27
image

However, if I add startrow=1 to the request, the rowCount returned is correct (except I'm missing the first item).
_api/search/query?querytext=%27benedict%27&querytemplate=%27{searchterms}%20AND%20PECVStatus:3%27&startrow=1
image

Steps to reproduce

Expected behavior

The number of results returned (RowCount) should be equal to TotalRows, at least in cases where RowLimit and RowsPerPage is not specified

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APItype:archive-old-issueIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions