I have a site template that has a library called ContentLibrary. I want to do a search that returns only item and document results from those libraries that are in various sites and site collections. I tried using contains with Path and ListURL but both return no documents. Path:/ContentLibrary/ ListURL:/ContentLibrary/

How can I filter on library name or use a contains for a URL?

Is there a way to do it with result sources?

Update 1 Created a new result source using ListURL:ContentLibary and it returns all the libraries needed but not the items inside.

Update 2 I thought I was going to be able to just do this in the query for the CSWP. ListUrl:ContentLibrary (contentclass:STS_ListItem OR IsDocument:True) owstaxidmetadataalltagsinfo:{QueryString.MyParameter1}

ListUrl only seems to only allow the return of lists.

2 Answers 2


Please refer to this article to create a new result source which limit search results within same name document library and items in it:

enter image description here

  • Is there a way to do it without explicitly naming each list/library? There's currently 15 and I expect it to grow over 150 Commented Jun 17, 2020 at 11:10

I am coming to the conclusion that there is no way to construct this query as intended. My next endeavor is to create a content type hub and add a published content type to that library in the site template. That should allow me to filter on a single content type id. Unfortunately I'll have to update all the items to the new content type... I'll continue to pursue this solution and update it in case is works. Would happily take someone else's solution to this though.

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.