To filter MacroView DMF and Message search masks to be based on content type, use the "where" clause in the mask header as follows:
Syntax
- <Mask Name="Mask name" TrimDuplicates="False" EnableStemming="True" Scope="legal" Where="ContentTypeId:0x01* " IgnoreFileTypeQuery="True">
Note: place a "space" between * and "
Examples
- Return documents and folders
Where="ContentTypeId:0x01* "
- Return document sets only (if using document sets for projects then this becomes a project search)
Where="ContentTypeId:0x0120D520* "
- Return custom document sets
Where="ContentTypeId:0x0120D520359* "
- Return items that match particular content types only
Where="ContentTypeId:0x010100776D10CC9E0943CEA6FE18350BDDD96C* OR ContentTypeId:0x010100BF89298E8523354B99672AB5830DD26A* OR ContentTypeId:0x0120D52000075BF3D401122B4181DA22E66098D4F1* OR ContentTypeId:0x010100776D10CC9E0943CEA6FE18350BDDD96D* " >
- Return folders
Where="ContentTypeId:0x0120* "
- Return files
Where="ContentTypeId:0x01* "
Using content type searches in the Save As to SharePoint dialog
When using search mode in the Save As to SharePoint dialog from Office applications, the search results are automatically filtered to return only files of the appropriate file type so search masks that are defined to return only folders or document sets will by default return no results. To make the search return the matching folders or document sets add a flag to the mask definition to make the search ignore the file type filter. e.g.
- <Mask Name="Mask name" TrimDuplicates="False" EnableStemming="True" Scope="legal" Where="ContentTypeId:0x01* " IgnoreFileTypeQuery="True">
Notes:
- Folders and document sets can be returned in search results. If a user double clicks on, or Opens, a folder MacroView DMF will switch to browse mode and open the selected document set or folder
- If you want documents only don’t include the Where clause
- If you want documents, folders and document sets use Where="ContentTypeId:0x01* "
- The Where clause overrides DMFs automatic restricting of the results to documents so results will include aspx pages. To prevent this include the following in your Result Source:
- o -fileextension:aspx
- MacroView DMF only returns documents, folders, and document sets so other items are not returned in search
Related articles: