Enhancing a Text Search for Items Using Operators
The search function inPTC RV&S allows you to carry out simple text searches of your item database. The text search function uses a search syntax similar to many common Web search engines.
Note the following:
• Text searches look for information in short or long text fields only. The search does not capture information in other field types, such as integer, pick, floating point, logical, date, user, or group fields.
• Most symbols, such as !, #, [], and @, are ignored by default; however, your PTC RV&S administrator may configure a limited set of symbols that can be included in searches. Your administrator will advise you of symbols that have been configured to work in searches.
• Searching is case-insensitive. For example, java returns items containing java, Java, and JAVA.
• Adding more words narrows the search, it does not expand it. Meaning, PTC RV&S searches for items that include all of the words in the string, not items that include any of the words in the string.
• Text searches rely extensively on the underlying database. If you are consistently having problems with your searches, see yourPTC RV&S administrator.
• If there is an error in the search, no items are returned.
• For rich content fields, a text search returns results from text in rich content fields only. You cannot search for HTML elements or attributes in rich content fields.
• For detailed information on how supported databases handle text searching and text search operators, refer to your database documentation.
Text Search Operators
The search feature supports full text searching using the following operators to enhance the search:
Operator
|
Description
|
“”
|
Searches for an exact word or phrase. Meaning, PTC RV&S matches words that follow one another, separated by whitespace and/or punctuation.
For example, “medical device” returns items containing medical device, not medical devices.
|
AND
|
Searches for multiple words or phrases.
For example, “battery life” AND “battery size” returns items containing both words or phrases, not one or the other.
|
Most databases ignore common words such as a or the in search text. Using AND in front of a common word allows you to include it in your search. You can also use the + symbol to represent the AND operator.
|
|
OR
|
Searches for either word or phrase.
For example, “MD5000” OR “MD5002” returns items containing MD5000 or MD5002.
|
Using multiple OR operators can increase the time required for your text search.
|
|
-
|
Excludes words or phrases from the search.
For example, “product lifecycle” -management returns items containing product lifecycle, not product lifecycle management.
|
The - operator is ignored inside quotes and if there is no whitespace before the operator.
For example:
word1-word2 searches for word1 word2
while:
word1<space>-word2 searches for word1, not word2
|
|
~
|
Searches for words similar to the specified word (known as a fuzzy search). This also takes into account misspelled words.
For example, ~applied returns items containing applied, applies, and apply.
|
*
|
Searches for possible combinations of the word (known as wildcard substitution).
For example, except* returns items containing exceptional and exception.
|
How to use the wildcard depends on the underlying database. For example, MS SQL only allows the * to be placed as a suffix while Oracle allows the * to be placed as a prefix or suffix to the word.
|
|
LIKE
|
Searches for all characters that match the specified word or phrase. This is useful if you want to search for specific character patterns in a text field, for example, a serial number in a hardware part.
|
The LIKE operator performs a search without indexes, resulting in your search taking longer and impacting the performance of the PTC RV&S server. If you are searching for a specific word, do not use the LIKE operator. If you cannot create a text string to search for a specific word, but need to search for non-alphanumeric style words, use the LIKE operator. To improve the performance of a text search using the LIKE operator, you must ensure that your query includes specific filters to reduce the volume of items that PTC RV&S must process. For example, filtering by item type alone is insufficient, unless you add specific filters to the query. Adding specific filters may allow the query to search existing indexes in the database.
|
For example, LIKE w1<space>w2 searches for the characters w, 1, <space>, w, 2, anywhere in a text field. Because there is no concept of words with the LIKE search operator, w1<space><space>w2 would not return a match.
Another example, LIKE “w1<space>w2” matches the characters “, w, 1, <space>, w, 2, ”, anywhere in a text field.
|
• Spaces, *, and “ ” are treated as characters to search for in the specified string.
• Depending on your interface, what you type may differ. For example, if you type LIKE "w1 w2" in the GUI, it matches the characters “, w, 1, <space>, w, 2, ”. In the CLI, you must escape the double-quotes twice, once for the shell that you are running the command from and another for the underlying query definition parser (because it encloses the LIKE operator in double quotes).
• Databases that do not have text searching installed and enabled are unsupported, and the results of text queries are undefined.
• A historic search of a text field (the historic value query filter) and a historic evaluation of a query (a query filter against a text field, found in a query backed relationship field, run by fetching an issue historically) behave like the LIKE operator.If you add the LIKE operator to the beginning of a string in these instances, it is ignored.
• Searches are case sensitive or case insensitive based on the configuration of the PTC RV&S database.
|
|
Searching for Text Using a Project Filter
In the GUI, you can also apply project filters when you perform a text search. For example, you can search for items within the SourceCode project that contain the string “null pointer exception”.
In the Web UI you can use filters to display items from a specific project or projects (for more information see
Filtering Items), and then perform a text search on the results.