I m useing the SP Search API to get results from a subsite with http://localhost/_api/search/query?querytext='test path:http://localhost/subsite works fine , but it also returns the results of the sub-subsites like http://localhost/subsite/website . How do I have to modify the url to exclude the sub-subsites from the search ?

Thank you for your help

2 Answers 2



Search searches everywhere it is allowed to search (index)

If you don't want things from subsites in the index you need to exclude them from being indexed in site settings or library settings


I found a soloution . you can use WebId= instead of path:

for example:


Your Answer

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

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