1

I am using the Search REST API.

With this following url I get all sites:

http://localhost/_api/search/query?querytext='*'&trimduplicates=false&rowlimit=50&refinementfilters='contentclass:equals("STS_Web")'

But I would like to only get all sub-sites from example http://local/teamsites/ and http://local/Supportsites/.

Is it possible?

Any kind of help is appreciated!

1 Answer 1

3

Sure!

Just add path:http://local/teamsites/* OR path:http://local/Supportsites/* to your query, like so:

http://localhost/_api/search/query?querytext='path:http://local/teamsites/* OR path:http://local/Supportsites/*'&trimduplicates=false&rowlimit=50&refinementfilters='contentclass:equals("STS_Web")'
1
  • where will i add this code? can I add this inside a CEWP / script editor web part ?
    – samolpp2
    Mar 4, 2016 at 8:08

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.