3

I'm experimenting with the Search API in SharePoint. I would like to retrieve recently changed items for a specific site.

I can easily retrieve all recently changed items for the entire SharePoint-tenant, but I'm not able to only retrieve items for a specific site. Is it not possible to use the path-key?

I use the following query:

https://bleau.sharepoint.com/sites/intranet/_api/search/query?querytext='path:"https:%2f%2fbleau.sharepoint.com%2fsites%2fintranet"'&refinementfilters='or(ContentType:("article*")%2cContentType:("blogentry*")%2cContentType:("event*")%2cContentType:("gallery*")%2cContentType:("knowledge*")%2cIsDocument:(true))'&sourceid='ba63bbae-fa9c-42c0-b027-9a878f16557c'&clienttype='ContentSearchRegular'

I noticed that if I remove the refinement filter, it seems that the path is taken into consideration. So if the refinement filter conflicting with the path part?

Thanks in advance.

1 Answer 1

0

I would start by adding a "*" to the path. path:https://bleau.sharepoint.com/sites/intranet/* then continue to build up your query. You don't need the refinement filter if you are building up the query yourself. You can or together your ContentType filters and add IsDocument to the end.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.