1

I would like to search only document libraries in a site(not the document). I tried below search but its returning documents within the document library.

path:"http://localhost/managedpath/sitename" and contentclass:"STS_List"

1 Answer 1

1

Check out this page that gives more examples of the other contentclasses you can use for your search query. SharePoint Power Searching Using ContentClass

See the List ContentClass codes table where STS_List_DocumentLibrary might do the trick.

6
  • Thanks that worked. Can you please let me know from which managed property I can get the list title. The title managed property is returning "Site Title" as a prefix. Is there a way I can get the Document Library Title? Commented Aug 11, 2017 at 19:58
  • Hello, When I did a test using a search box, refiner, and results web part I set the following in my results query and it displays the Document Libraries by name in the search results: path:"localhost/managedpath/sitename" contentclass:"STS_List_DocumentLibrary"
    – Chris G
    Commented Aug 11, 2017 at 20:11
  • Not sure why it's giving me the Site Title. Commented Aug 14, 2017 at 15:24
  • I am able to get document libraries but it's not showing the libraries if there are no documents in it. Is this expected behavior? Commented Aug 14, 2017 at 15:25
  • @RaviKhambhati Were you able to resolve issue of Site Name getting prefixed?
    – Mani
    Commented May 19, 2021 at 0:54

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.