SolidPractices: Searching in SOLIDWORKS PDM

Revision History
Rev #DateDescription
1.0March 2019Revised for use by customers and reset as document version 1.0
2.0August 2021Revised for SOLIDWORKS PDM 2021 release
2.1September 2024Validated for SOLIDWORKS PDM 2024

Note

All SolidPractices are written as guidelines. It is a strong recommendation to use these documents only after properly evaluating your requirements. Distribution of this document is limited to Dassault Systèmes SolidWorks employees, VARs and customers that are on active subscription. You may not post this document on blogs or any internal or external forums without prior written authorization from Dassault Systèmes SolidWorks Corporation.

This document was updated using version SOLIDWORKS 2024 SP4. If you have questions or need assistance in understanding the content, please get in touch with your designated reseller.

  1. Preface

SOLIDWORKS PDM customers rely heavily on searching the vault to locate the vault contents. The purpose of this SolidPractices document is to provide guidance about the best way to search for files and to return accurate results. The information in this document helps you understand how the search functionality works in SOLIDWORKS PDM Professional, SOLIDWORKS PDM Standard, or SOLIDWORKS Enterprise PDM.

This SolidPractices document includes information about:

  • Improvements to search in previous product releases

  • The types of searching available to users

  • Setting defaults on search cards

  • Creating favorite searches

  • Modifying search result columns

  • SQL modifications to improve search speed

  • The best ways to fill out the default complete search card

  • Do’s and Don’ts

  • Command line options

  • Content search

Your Feedback Requested

We would like to hear your feedback and also suggestions for new topics. After reviewing this document, please take a few minutes to fill out a brief survey. Your feedback will help us create the content that directly addresses your challenges.

  1. Overview

A SOLIDWORKS PDM vault (PDM vault) is comprised of two parts:

  • A Microsoft® SQL Server® database containing the metadata for the vault

  • An archive server that contains the physical versions of each file in the vault

You can perform two different types of searches on a PDM vault. The first and most common type is a metadata search. In essence, a metadata search is an SQL query against the database. The second type of search is a content search, which searches for data or information inside the physical files on the archive server. A content search requires the installation of either Windows® Search or the Microsoft Indexing Service. It is this service that SOLIDWORKS uses to catalog the physical files on the SOLIDWORKS PDM archive server.

You perform a vault search from a system that has a SOLIDWORKS PDM client installation. All searches originate from a client system. The text you type is converted to an SQL query on the client machine. This SQL query is sent to the SQL server for processing. The SQL server generates a results list and passes the results on to the client system for display.

  1. Search Improvements History

  2. Improvements in SOLIDWORKS PDM 2020

Searching in SOLIDWORKS PDM 2020 and later versions offers use of the AND, OR and NOT operators. You can use these operators with the search criteria in the edit-box type fields on search cards.

When you upgrade to SOLIDWORKS PDM 2020 or later, previously saved searches update to follow the new search rules while maintaining the previous behavior and search results.

The default Complete Search card has three such fields as shown with an orange background in the following images. Description and Number on the Name and Location tab and Revision on the Version Data tab.

You can use these search operators in any search card, in a Web2 search, in the SOLIDWORKS PDM Search tool, and in quick search.

You can prioritize and group the evaluation of the operators using parentheses ().

The following rules apply for using the operators:

  • Search strings are case-insensitive. Searching for Permutation, permutation, PeRmUtAtIoN and PERMUTATION all return the same results.

  • Operators are case-sensitive and you must capitalize them.

  • The valid operators for variables of a numeric or date type are =, !=, <, <=, > and >=

  • When using multiple operators in a search, SOLIDWORKS PDM evaluates the search operators in this order: (), NOT, AND and OR.

  • You can use the AND, OR and NOT search operators or their equivalent symbols &, | and respectively.

  • You can search for text, integer numbers, float and date type data.

  • You can use the AND and OR operators with or without the colon (:) symbol. For example, for the AND operator, use ANDAND:& or &:.

  • The search field supports using the asterisk (*) and question mark (?) as wildcard characters.

  • You can use the equals (=) character to search for an exact string. For example, to search for a tools string, enter the search string as =tools.

  • To search for a string that contains more than one word, you can use " " to search for the string in the same order of words. For example, to search for pipe tools, enter "pipe tools".

  1. Rules for using the escape symbol

Search for String withInput String
Double quotation marks

String with an escape symbol \.

For example, to search for "speaker", enter the string as \"speaker\"

Double quotation marks that are a part of an explicit search

String with an escape symbol \.

For example, to search for 3" pipe, enter the string as "3\" pipe".

Numeric constant followed by "

String with or without escape symbol.

For example, to search for a length value such as 3", enter the search string as 3\" or 3".

  1. Using the AND (&) operator

Searches for results that include both the term before and the term after the operator.

Search String ExamplesDescription

term1 AND term2

TERM1 & TERM2

AND: term1 term2

&: term1 term2

Returns the match that includes term1 and term2. Terms may appear in any order in the results.

Examples of valid search results:

term1 term2

term2 term1

term3 term1 term2

"(*" term1 term2 "*)" OR "(*)" term1 term2

AND is the implicit operator for the SPACE character.

Returns the match that is enclosed in the parentheses and that contains term1 and term2.

Examples of valid search results:

(term1 term2)

(term2 term1 term3)

"(*" "term1 term2" "*)" or "(*)" "term1 term2"

AND is the implicit operator for the SPACE character.

Returns the match that is enclosed in the parentheses and that contains the string term1 term2.

Examples of valid search results:

(term1 term2)

(term3 term1 term2 term4)

  1. Using the OR (|) operator

Searches for results that include the term before or after the operator or both.

Search String ExamplesDescription

term1 OR term2

TERM1 | TERM2

OR: term1 term2

|: term1 term2

Returns the match that includes either or both term1 and term2.

Examples of valid search results:

term1

term2

term2 term1

"(*" term1 OR term2 "*)" or "(*)" (term1 OR term2)

Returns the match that is enclosed in the parentheses and that includes either term1 or term2 or both.

Examples of valid search results:

(term1)

(term3 term2)

(term2 term1 term4)

  1. Using the NOT (!) operator

Searches for results that do not include the term after the operator.

Search String ExamplesDescription
NOT TERM1

Returns values other than term1.

Examples of valid search results:

term2

term3 term4

!="term1 term2"

Returns values other than string term1 term2.

Examples of valid search results:

term3

term2 term1

!(2019-01-11)

Returns dates other than 2019-01-11.

Examples of valid search results:

2019-02-12

2017-03-11

  1. Improvements in SOLIDWORKS 2017

Effective with the release of SOLIDWORKS PDM 2017, you can search local files that you add to the vault in offline mode.

To search the local files in File Explorer, right-click inside the folder and then click Search Local Files. This searches the local view. The search does not return local files that are on a different client machine’s view.

On the SOLIDWORKS PDM Administration tool Menus page, administrators can modify the Search Local Files option to appear to you when you are viewing files in the local view.

  1. Improvements in SOLIDWORKS PDM 2016

Effective with the release of SOLIDWORKS PDM 2016, you can now use Windows Search Service for content search along with Microsoft Index Service. Chapter 9 of this document provides more information about content search.

  1. Improvements in SOLIDWORKS PDM 2015

SOLIDWORKS Enterprise PDM 2015 introduced the concept of version number columns in Windows Explorer. This functionality applies to file lists and search results.

  • The Version Number column does not appear for search results by default. You must add this column manually.

    • To add this column, create a column set for the search results and include the <Version Number> tag.

  • Be sure to define which users can use the search card and therefore the new column set defined for it.

  1. Improvements in SOLIDWORKS PDM 2012

SOLIDWORKS Enterprise PDM 2012 introduced the embedded search tool. This tool allows users to search from within Windows Explorer and from standard Windows file-based dialog boxes.

When using the embedded search, it is only possible to search for files and folders.

  • It is now possible to search from SOLIDWORKS file-based dialog boxes such as Open, Save As, Insert, and Replace.

  • and Save As dialog boxes in Adobe® Reader®, Microsoft Word, and Microsoft Excel®.

  • To run the embedded search tool, users access the local vault view by selecting the Complete Search function from the drop-down list.

SOLIDWORKS PDM Search ToolEmbedded Search
Applicable to SOLIDWORKS PDM Professional.Applicable to SOLIDWORKS PDM.

Supports search for:

  • Files and folders

  • Users

  • Items

Supports search for files and folders.
Separate interfaceEmbedded in Windows File Explorer and other file-based dialog boxes such as Open and Search.
Allows you to choose the vault to search and search multiple vaults.Performs search in the vault from which you initiate it.
Supports creating and deleting Favorite searches.Does not support creating and deleting Favorite searches.

All commands are available from the toolbar, the Search and Edit menus, and the file shortcut menu.

These include the following commands that are not available in an embedded search and are applicable to SOLIDWORKS PDM Professional only:

  • Open search result

  • Opens an Excel spreadsheet containing the search results.

  • Save search result

  • Saves search results as a comma-separated file.

  • Print files

  • Prints the selected files.

  • Help

Provides field level help for search forms.

Commands are available from the SOLIDWORKS PDM menu bar, the Windows File Explorer toolbar, and the file shortcut menu.

These include the following command that is not available in the SOLIDWORKS PDM Search tool:

  • Browse to

Changes the focus of Windows File Explorer to the folder containing the selected file and closes the search.

  1. Getting Good Results - Fast

  2. Search Result Columns

SOLIDWORKS PDM comes with default search result columns. You can create other results columns by selecting New Column Set in the card editor when the search card is open. You can also create results columns from the SOLIDWORKS PDM Administration tool by going to Columns > New Column Set, and creating a Search Result type column set.

It is impossible to define which column set to use dynamically while running the search from the client computer.

If the default column set shows more information than is required for the search, you can create a column set that displays only the results you need. This may result in a more efficient query.

Be sure to save the new column set to make it available for assignment to search cards.

If the default columns do not show all the information that you require by the search, adding more columns may slow the search slightly because the search returns more data. However, this is still faster than running two separate searches to gather all the information you need.

  1. Search Card Default Values

You can save the amount of time that it takes to fill out the search cards by specifying search card defaults. This is done by opening the search card in the card editor and selecting Card > Default Values.

  1. Search Card Favorites

After creating and filling out a search card and specifying the defaults, you can save the card as a search favorite and share the search with other users in the vault. Users that have permissions to see the search favorites see the card in a single-level tree structure in the search tool. Users can also access the search cards from the embedded search tool. In both cases, the search favorites appear with a

You can run Search favorites across multiple vaults. If you use a favorite for more than one vault, be sure to create the favorite with relative paths.

  1. SQL Server Adjustments

It is possible to improve search performance by altering the vault database settings for the recovery model and log file size. You can choose the Simple recovery model for the vault database through the Microsoft SQL Server Management Studio tool. To access this setting, right-click the vault name > Properties > Options > Recovery Model.

Controlling the size of the transaction log file can also aid in searching performance. It is possible to shrink the transaction log size after first making a backup. To accomplish this, right-click the database > Tasks > Shrink > Files, and then select the transaction log.

In Microsoft SQL Server Management Studio, you can also create a maintenance plan to rebuild the indexes on the vault tables periodically to reduce data fragmentation, which potentially occurs because of many UPDATE, DELETE, and INSERT statements on the tables.

Important: Never create manual indexes on a SOLIDWORKS PDM database. 

  1. Filling Out the Search Card

A SOLIDWORKS PDM search returns results to the client more quickly when the SQL query runs faster on the SQL server. Therefore, it is important to optimize the search card choices so that the search runs as fast as possible.

When entering the search terms, provide as much detail as possible. Consider the following points:

  • If you know that the files sought do not exist in the root folder but somewhere in another folder beneath the root folder, be sure to enter as much of the path you know in the Look in field. You can enter the path directly, or use the Browse to locate the folder.

  • When searching in the Name field of the Complete Search card, SOLIDWORKS PDM always performs the search with implicit wildcards. These wildcards are both before and after the search term. For example, searching for the term “part” searches for “*part*”. Users can restrict this behavior by adding a wildcard explicitly to their search terms. For example, if you search for the term “part*”, you receive the results faster. This is because SOLIDWORKS PDM searches for “part*” explicitly instead of “*part*”. This means that the search ignores any name that does not start with the letters p-a-r-t.

  • If you know the exact filename, type the name in the Name field. To search for an exact match for a string, use the equals “=” symbol in the search terms. For example, searching for the string “123” returns “0123984.sldprt” and “G123-9a.sldprt” because of the implicit use of wildcards. Searching for “=123.sldprt” returns only “123.sldprt”.

  • Exclude file types that are not required in the search results. To exclude filenames that contain a specific string from the search results, use the “!” operator. To exclude SOLIDWORKS parts from the search, use the search term “! sldprt”. Use of the “!” operator before a word to exclude works for any string.

  • Enter multiple terms in the Name field. You can enter multiple search terms in the Name field only. Separate each search term with a space or comma. Multiple terms that you enter here perform an “OR” operation. It is impossible to modify the terms in the Name field to make this an “AND” operation.

  • Searching multiple vaults at one time. To do this, use a relative path instead of an absolute path and select the check boxes for the vaults you want to search. Multiple vault search is only possible from the stand-alone search tool and not from the embedded search tool. After entering the search criteria and selecting the vaults you want to search, the Found In results indicate the vault in which the result is found.

  1. Stopping a Search Manually

Stopping a search before it completes is not recommended though it is not harmful. Doing so results in error messages in the client logs. This cause confusion for users who may interpret the error messages as a problem in the vault.

The following are examples of typical errors that occur when canceling a search:

-----

Description: Error running query in SpDbOdbc

State=01000

Msg=[Microsoft][ODBC SQL Server Driver][SQL Server]Warning: The join order has been enforced because a local join hint is used.

Module: Search.exe

Function: hGetErrCode

Error code: E_EDM_DATABASE_LINK_FAILURE

Error code general description: A communication link failure occurred when accessing the database server. The database service might have been restarted or the network might have gone down. Please try the operation again and contact your system administrator if the problem persists.

-----

Description: Error running query in SpDbOdbc

State=S1000

Msg=[Microsoft][ODBC SQL Server Driver]Unspecified error occurred on SQL Server. Connection may have been terminated by the server.

Server: LPT-TOR

Database: PDM

Module: Search.exe

Function: hGetErrCode

Error code: E_EDM_DATABASE_ACCESS

Error code general description: Could not access the item in the database.

-----

Description: Error running query in SpDbOdbc

State=01000

Msg=[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()).

Module: Search.exe

Function: hGetErrCode

Error code: E_EDM_DATABASE_LINK_FAILURE

-----

  1. Error Log For Search Problems

Errors that occur when searching appear in the client log file. This log file is available for examination from the SOLIDWORKS PDM Administration tool under Local Settings > Log File. The log file may show the module as Explorer.exe or Search.exe depending on the error that occurs. The function may also indicate that the error is search-related. This is shown in the last line of the error, in this example where the function is SpSearch::mhStatFileSearch. It is impossible to define which column set to use dynamically when running the search from the client computer.

If the default column set returns more information than is required for the search, you can create a column set that displays only the results you need. This may result in a more efficient query.

Be sure to save the new column set to make it available for assignment to search cards.

If the default columns do not show all the information that you require by the search, adding more columns may slow the search slightly because the search returns more data. However, this is still faster than running two separate searches to gather all the information you need.

  1. Command-Line Searching

Initiating a search from the command line opens the SOLIDWORKS PDM search tool dialog box. The command does not actually perform a search. It does however offer several options for how the search tool dialog box opens for the user.

  1. Opening the Search Tool User Interface From a Command Prompt

To open the search tool dialog box from the command line:

  1. Open a Windows command prompt.

  2. Browse to the SOLIDWORKS PDM installation directory. The default directory is C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS PDM.

  3. Locate the search.exe program file and run the file.

  1. Command-Line Options

There are several command prompt options available to modify how the user interface (UI) opens.

  • /V:<VaultName> defines which vault to select for searching when the search tool GUI opens.

  • /S:<SearchFormName> displays the selected search form upon opening.

  • /F:<SearchFavoriteName> starts the search favorite.

  • /P:<SearchPath> places this path into the Look in text box on the Complete Search form.

  • /HF hides the search form in the UI.

  • /HT hides the tree pane in the UI.

  • /HP hides the search preview pane.

  1. Content Search

SOLIDWORKS PDM also provides the ability to search through the content and properties of the physical files that are stored on the archive server file structure. This feature is only available in SOLIDWORKS PDM Professional. This is possible through the use of Microsoft Windows Search Service or Microsoft Indexing Service. In either case, SOLIDWORKS PDM indexes the archive server file structure and not the SQL database. This is not to be confused with SQL table indexing.

These services create a catalog for each vault and an index that contains the tables, content, and properties of the files. A SOLIDWORKS PDM content search performs a search of this catalog.

The services include filters for Microsoft Office® files, HTML, .txt, and MIME messages. You can also add to the installation for the GZ and PDF format files. SOLIDWORKS files are supported with the default filters included with Windows Search or Microsoft Indexing Service when searching for properties. When searching for content in SOLIDWORKS drawings, an index Filter (iFilter) for SOLIDWORKS files is required. To install the iFilter, SOLIDWORKS must be installed on the indexing server. The GZ filters are included with the installation media under \SWPDMServer\Support \Filters or \SWPDMServer\Support \Filters64 (for 64-bit systems). Other filters (such as PDF) are available for download from Microsoft.

The SOLIDWORKS PDM Installation Guide provides detailed steps for setting up the services and enabling content search.

We hope that you find this document informational and useful and request that you leave a brief feedback about the topics that you want us to cover in the next revision of this document. Click here for a complete list of SolidPractices documents available from DS SOLIDWORKS Corp.