I have been working with a client on an existing SharePoint system.  One of the issues the users are facing is a confusing number of ways of finding the files they are looking for.  They are making the move from an old network shared folder to SharePoint.  And whilst SharePoint has a lot of benefits to offer over a network folder, some of these benefits appear to be confusing to new users, especially as they appear to off the same functionality but the results can appear to be quite different.

One such feature is the “Find a file” filter box that can be displayed at the top of a document library list view.  On the face of it, this provides a simple way to search a document library.  However, when you start using it you discover some unexpected flaws.  Firstly, it likes to aggressively remove duplicates… too aggressively, e.g. if the file names are similar but the contents is completely different.  The only way to show the duplicates is to scroll to the bottom and click a link to show duplicates.  Secondly results are displayed in alphabetical order (or whatever order the view is shown in), not by relevance to the query terms.  Thirdly, if the user then selects filter options on the left navigation bar, these clear the “Find a file” filter terms (you need to apply the navigation bar filters and then use the “Find a file” box).

Find in Files

The upshot of this is that the client would prefer to encourage users to use the main search box at the top-right of the screen, which results in a much better and more consistent search experience.  To enforce this I have been asked to remove the “Find a file” search box.  Now this could be done by manually editing the pages and updating the webpart properties to disable the “Find a file” but this isn’t a very efficient way to make the changes, especially if it has to be done on multiple views, on multiple document libraries and in multiple environments (dev, test, staging and production).

A much more efficient method would be to use a Feature receiver to make the changes.   This code will check all the views in a SharePoint document library to find an XsltListViewWebParts and then disable the “Find a file” boxes (InplaceSearch):