SharePoint 2013 Community - can't pull documents from document library in search result
-
09-10-2020 - |
Question
I am using SharePoint 2013 Community and I am trying to show the list of pdf documents in the search result. I have a document library in the root site and i have uploaded all the documents in there.
I have dragged the search result control in a page in the sub site and I am writing following query:
{searchboxquery} path:"http://server-sharep/Shared%20Documents/*"
It i just listing this page in search result. Do you know how to pull list of PDF documents from the library? Home - Documents server/Shared Documents/Forms/AllItems.aspx
Solution
Leave the Path and remove the {searchboxquery}. You can add FileExtension:pdf to only return PDF and (IsDocument:"True" OR contentclass:"STS_ListItem") to only return documents.
so your final query will be:
path:"http://server-sharep/Shared%20Documents/*" FileExtension:pdf (IsDocument:"True" OR contentclass:"STS_ListItem")