Skip to content

SharePoint Online REST Search Refiners not working for managed properties ViewableByExternalUsers and ViewableByAnonymousUsers #9098

Open
@sharepointalist

Description

@sharepointalist

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

SharePoint Online REST Search API requests with refinement values specified for managed properties ViewableByExternalUsers and ViewableByAnonymousUsers returns 0 records instead of expected number of records. Specifying ViewableByExternalUsers:True in query works fine, only using it as a refiner results in a problem. This used to work at least few weeks ago. Both managed properties are refinable.

Steps to reproduce

  1. Sent REST api serach request:
    {"request":{"SelectProperties":["Filename","FileType"],"SortList":[],"RowLimit":0,"StartRow":0,"Properties":[],"QueryTemplate":"(ContentTypeId:0x0101*)" ","Refiners":"ViewableByExternalUsers(sort=name/descending,filter=1000/0/),ViewableByAnonymousUsers(sort=name/descending,filter=1000/0/)","TrimDuplicates":false}}
  2. The response includes refinement values: [
    {
    "Entries": [
    {
    "RefinementCount": "754",
    "RefinementName": "True",
    "RefinementToken": "ǂǂ54727565",
    "RefinementValue": "True"
    },
    {
    "RefinementCount": "2448",
    "RefinementName": "False",
    "RefinementToken": "ǂǂ46616c7365",
    "RefinementValue": "False"
    }
    ],
    "Name": "ViewableByExternalUsers"
    },
    {
    "Entries": [
    {
    "RefinementCount": "315",
    "RefinementName": "True",
    "RefinementToken": "ǂǂ54727565",
    "RefinementValue": "True"
    },
    {
    "RefinementCount": "3921",
    "RefinementName": "False",
    "RefinementToken": "ǂǂ46616c7365",
    "RefinementValue": "False"
    }
    ],
    "Name": "ViewableByAnonymousUsers"
    }
    ]
  3. Send another REST api call with refinement token:
    {"request":{"SelectProperties":["Filename","FileType"],"SortList":[],"RowLimit":0,"StartRow":0,"Properties":[],"QueryTemplate":"(ContentTypeId:0x0101*)" ","Refiners":"ViewableByExternalUsers(sort=name/descending,filter=1000/0/),ViewableByAnonymousUsers(sort=name/descending,filter=1000/0/)","TrimDuplicates":false,"RefinementFilters":["ViewableByAnonymousUsers:ǂǂ46616c7365"]}}

The number of records returned is 0.

Expected behavior

Should return the number of records based on refinement value (token).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APIarea:searchtype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions