You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 28, 2024. It is now read-only.
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."}}}
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