Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

pnp.sp.search does not work with Refiners set #241

@arheom

Description

@arheom

Category

[ ] Enhancement

[X] Bug

[ ] Question

Problem

I am trying to use pnp.sp.search to get some elements from SP Online. I am passing a list of Refiners, but I am getting the following error from search:
{"odata.error":{"code":"-1, Microsoft.Data.OData.ODataException","message":{"lang":"en-US","value":"An unexpected 'StartObject' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected."}}}

The code I am using is:
pnp.sp.search({ Querytext: queryText, SelectProperties: selectProperties, EnableSorting: true, Refiners: ["DisplayAuthor"], SortList:sorts });
Everything works well if I remove the Refiners property.
I see on the internet that property might be a string and not a string[]:
https://blogs.msdn.microsoft.com/nadeemis/2012/10/20/how-to-postquery-in-sharepoint-2013-search-rest-api/
but in the actual request we have the string[].

Thanks!
Bogdan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions