Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have multiple subsites in single site collection. All of these subsites have document library with same name. So is it possible using JSOM to read data from multiple document libraries with same name and display it to the user?

If so I would appreciate if I can be pointed out to any reference on how to do it. I know that we can do it by Content search webpart, but I want to know if it can be done programmatically using JSOM.

Thanks,

share|improve this question

2 Answers 2

up vote 1 down vote accepted

For such scenarios SharePoint 2013 search Query APIs probably is the best bet, where the following APIs are available:

Example:

The following query returns the all the documents using REST endpoint:

https://[server]/_api/search/query?querytext='IsDocument:1' 

References

Understanding result sources for search in SharePoint Server 2013

share|improve this answer

use SPSiteDataQuery for querying the lists and libraries on each site from SiteCollection level by setting its Webs property to

"<Webs Scope=\"SiteCollection\" />";

on the Below MSDN Link, their is example how to fetch it.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx]1

share|improve this answer
    
I am working on SharePoint online . SO cannot use server object model. I can only use Client object model. –  user117048 Jun 11 at 16:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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