1

I'm trying to get all sites for a user on which he has permissions. For this I'm using the search api. In a for-loop from 0 to totalRows. This is my request url:

https://www.intranet.i/site/_api/search/query?querytext='contentclass:STS_Web'&selectproperties='Title,URL'&startrow=" + i + "&rowlimit=100"

This is working fine for a lot of pages, but some are not returned, any idea why?

Thanks in advance!

mbauer
  • 597
  • 1
  • 7
  • 21
  • How were you able to solve this? No answer for this question works for me. I only get a subset of lists. I don't even some Sites for which I am the owner. Strange! – Syed Mauze Rehan Aug 01 '15 at 10:51

2 Answers2

1

Try adding '&trimduplicates=false' to your query.

https://www.intranet.i/site/_api/search/query?querytext='contentclass:STS_Web'&selectproperties='Title,URL'&startrow=" + i + "&rowlimit=100&trim"
Aveenav
  • 4,199
  • 1
  • 14
  • 13
  • Still doesn't give the desired results? I have some Site Collections where I am the Primary Site Admin, I still don't get those Site Collections in this API call? Any suggestions? – Syed Mauze Rehan Aug 01 '15 at 08:45
0

Try adding

contentclass:STS_Site 

in your query along with web since the permissions may differ

Michael Colbs
  • 3,919
  • 2
  • 48
  • 96