Forum Discussion
Mike Jansen
Oct 06, 2017Iron Contributor
pnp.sp.search > syntax question (from SharePoint search API URL to PnP)
For the first time I do some testing using pnp.sp.search. My first simple test is like this: pnp.sp.search("SharePoint").then((result : SearchResults) Now I want to convert an api search to pnp. ...
- Oct 10, 2017
Got it!! I tried to put the filter in the querytekst. Seems to be a wrong approach. This is the working code:
pnp.sp.search(<SearchQuery>{ Querytext: "ContentType:TEST_matters", RowLimit: 10, EnableInterleaving: true, RefinementFilters: ["RefinableString18:equals('false')"], }).then((result: SearchResults) =>
Patrick Rodgers
Microsoft
You can pass a plain object of the search properties from the query string into the search method. You can check the wiki page on search to help get you started.
Mike Jansen
Oct 09, 2017Iron Contributor
Hi Patrick Rodgers. I tried this but it looks like I'm doing something wrong.
pnp.sp.search(<SearchQuery>{ Querytext: "ContentType:TEST_matters&refinementfilters=RefinableString18:equals("false")", RowLimit: 10, EnableInterleaving: true, }).then((r: SearchResults)
Can you help me out here?
Thanks
- Mike JansenOct 10, 2017Iron Contributor
Got it!! I tried to put the filter in the querytekst. Seems to be a wrong approach. This is the working code:
pnp.sp.search(<SearchQuery>{ Querytext: "ContentType:TEST_matters", RowLimit: 10, EnableInterleaving: true, RefinementFilters: ["RefinableString18:equals('false')"], }).then((result: SearchResults) =>