I would like to retrieve all document libraries with the help of SharePoint(2010/2016) Search in a site.
I am using FQL and when I tried below I got all lists in particular site. Is this the right approach or is there a better approach for the same.
<QueryPacket xmlns='urn:Microsoft.Search.Query'> <Query> <SupportedFormats> <Format revision='1'>urn:Microsoft.Search.Response.Document:Document</Format> </SupportedFormats> <Context> <QueryText language='en' type='FQL'>and(filter(path:string(\"/Forms/AllItems.aspx\")),sitename:string(\"http://host/sitename\"))</QueryText> </Context> <ResultProvider>FASTSearch</ResultProvider> <Range><Count>10</Count></Range> </Query> </QueryPacket>
Above approach is working fine in SharePoint 2010 but when I do the same in SharePoint 2016 it does not give any records. I would like to search "/Forms/AllItems.aspx" value in path field. It's working if I give the absolute URL but not for relative URL.
You can refer to below link on how to create test project for FQL.
As per @Lee_MSFT's response I tried my search criteria with "ContentClass:STS_List_DocumentLibrary" and it returns only document libraries. Because I need to search in the specific library, I added an additional filter for SiteName and it gave me the result but not all library.
So I tried below criteria with different properties but none of them gave me all libraries in a site.
Because none of above worked I tried below to see if I can get the document library that I am interested in and surprisingly got the record.
So looks like when I search path with the absolute URL I get the library but when I try to search all library with contentclass it's not returning all libraries.