An updated version has been released. This version adds the search term added to the search box after a serach is completed.
You can get the version 2.0 here:
A while back I create a solution that would filter a list by the metadata, but would only do this for items and metadata viewable in the current list view. Here are the original articles:
Thanks to all the good feedback and suggestions I have created another solution that will allow you to search any list by its metadata and will search ALL items visible or not. Another feature I have added into this solution is that it can be placed on any pages and when the person searches it will taken them to results page.
In order to do this we will need to have access to SharePoint designer and have permissions to edit with SharePoint designer. SharePoint designer will be used to create a Data View Web Part where results will be displayed.
There are two main steps to create this search.
- Create a Search Results page.
- Add the Search Web Part to any page.
Let’s go over the process of creating a search page.
Create a Web Part Page.
Next edit it in SharePoint Designer.
Now add a Data View Web Part to a Web Part Zone. To do this you will need to select the list or library from the Data Source Library. The list or library you choose will be the one that is search with this solution.
Then select the what columns want to show. Also add them as a Multiple Item View.
When you save the file you will get a warning, don’t worry go ahead and say yes.
Next you will customize how the list is filtered.
Choose what fields you will filter on or have the search look through.
For the comparison make sure you select contains so that it is not an exact match.
Next for Value your are going to select Create a New Parameter.
Complete the parameter with the following:
- Name: Search
- Parameter Source: Query String (this is how it looks at the URL for the search criteria)
- Query String Variable: Search
For each field/column that you want to search add another to the list and make sure the And/Or is set to Or.
When you click OK your list of items will disappear, but that is OK and is expected.
You are now done with the first major part. If you want to customize the list more, feel free to do so. To customize the Data View web part that has nothing showing just check the box under “Common Data View Tasks” called “Show with sample data”.
The last part is to load the Search Web Part. This web part is one that I created and will need to be downloaded placed on any page of your SharePoint site. I would add this to the Search Results page as well.
Next edit the Web Part with the Rich Text Editor and change the following:
- Search Results Location: This should be the full URL of where the Search Results page you created with the Data View Web Part is.
- Search Box Location: Designate if it will be on the left, center or right.
- Search Title: Name your search so that your end users know what they are searching.
Then save the changes and you should be able to search your list and view the results.
Here you can find a working example: List and Document Library Search