2

We have created a folder structure in Document library. Folder 1 \ SubFolder \ Documents. Now we have created a view under Folder1, where directly Documents are shown without SubFolders(Show Documents without Folder property of View). now whenever I search for some document Name ex. TestSearch.pdf, it gives me correct document but is showing me Folder also which is containing this document. I am searching through 'Find a File' inline search of SharePoint 2013. I can not restrict search service application to exclude folders from search results, as it will affect my main site Search also. Please suggest if anyone has any idea to do achieve this. enter image description here

1

Edit the page of the list you are talking about. Add the searchbox and search result webpart above or below that list. Modify the search query of the search result webpart which will show you only the documents in that list. From this point you have the OOTB list and your own customized search functionality on the same page.

  • Hey Ola, tried doing this but it looks different than 'Find a File' search as it shows results in Search Results webpart. Found that we might try to modify Result template. Let me know if you have any idea if i can go ahead and make changes for particular view only – Vishal_chorghe Nov 1 '18 at 15:17
  • Show me a printscreen how it looks like. – Ola Nov 1 '18 at 18:48
  • <script> $includeScript(this.url, "~sitecollection/_catalogs/masterpage/Display Templates/Search/CustomSearchHideFolder.js") </script> I Included the above code in Item_Default.html of Display Template. My javascript is getting called successfully but its working on site Search. but not working on 'Find a File' inline search. is there any other template used for inline search? – Vishal_chorghe Nov 5 '18 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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