Introduction to Searching
Find information quickly in ServiceNow by using any of the available searches. Searches are not case sensitive. Use advanced options for more specific queries:
- Wildcards: use a symbol to represent zero or more characters.
- Phrase searches: find a phrase with multiple terms.
- Searching lists: control the query for list searches of a specific field.
- Boolean operators: refine searches with operators such as AND and OR.
- Attachment searches: search in files that are attached to records.
- International character sets: perform searches with any Unicode characters.
- Punctuation: perform searches that contain punctuation.
Zing is the text indexing and search engine that performs all text searches in ServiceNow.
2 Available Searches
Use any of the following searches to find information in ServiceNow:
- Lists: find records in a list; search in a specific field (Go to), all fields (Search), or in a specific column.
- Global text search: find records in multiple tables from a single search field.
- Knowledge base: find knowledge articles.
- Navigation filter: filter the items in the application navigator.
- Search screens: use a form-like interface to search for records in a table. Administrators can create these custom modules.
Wildcards are available for Zing.
The following searches support single and multiple character wildcard searches:
- Global text search
- Knowledge base
- Lists (text searches of all fields)
To perform a single character wildcard search, use the percent sign (%) symbol. This wildcard finds terms that contain any one character to replace the percent sign. For example, to find text or test, search for:
To perform a multiple character wildcard search, use the asterisk (*) symbol. This wildcard finds terms that contain 0 or more characters to replace the asterisk. For example, to find planned or placed, search for:
You can use wildcard characters anywhere in a search term. If a wildcard returns too many options for an efficient search, a message appears asking you to refine the search. Administrators can configure the limit for wildcard searches with the glide.ts.max_wildcard_expansion property.
4 Phrase Searches
Use quotation marks to search for a phrase with multiple terms. Zing finds only matches that contain the exact words in the exact order you specify, ignoring stop words (common words that are excluded from searches) and punctuation. For example, the following searches return the same results because the stop word a is ignored:
"email a password"
Wildcards do not work within quoted phrases; they are ignored as punctuation.
5 Searching Lists
By default, a list view includes a Go to search option that includes a choice list and a search field. The choice list contains a general text search option in addition to an option for each column name in the list. The column names are actually the field names on the record form. Use the choice list in conjunction with the search field to filter the list of records by the desired field.
To use the Go to search:
- Navigate to a list of records.
- If necessary, modify the fields for the list of records by clicking the gear icon () and selecting the desired fields.
- From the Go to choice list, select the desired field on which to filter.
- In the search box, enter the text to search for.
- Click the search icon ().
5.1 Searching Values in Choice Lists
Each option in a choice list is defined with a column label and a value. For example, the State choice list field on the Incident form contains several options. The text you see for each option, such as New and Closed, among others, is the column label. Each of these column labels has an underlying value. On the Incident form, the default value for New is 1 and the default value for Closed is 7.
To search for records based on the values in a choice list, use the Go to search and do either of the following:
- Select for text as the Go to search option and enter the text of the column label. For example, entering Resolved when you search for text on a list of incidents returns all incident records that have Resolved somewhere in the record, including the State field.
- Select State as the Go to search option and enter the value for that state. For example, entering 6 when you search the State field on a list of incidents returns all incident records that have a state greater than or equal to (=>) 6. Assuming the default values for the Incident form, all records in the Resolved and Closed state appear because the value for the Resolved is 6 and the value for Closed is 7.
- Selecting State in the Go to search and entering Resolved would not return any records because the search is looking for the value, not the column label.
Administrators can see the underlying values of all choice list options by right-clicking a choice list field and selecting Show Choice List.
Choice list values are also useful for scripting. See Client Scripts for more information.
5.2 Using Column Search
In addition to searching by field or for text, you can also search individual columns in a list when UI15 or UI14 is enabled, starting with the Eureka release.
- Click the search icon () beside the personalize list gear icon to expand the column headers and add a search field to each column.
- To search a single column, enter the search text in the desired column search field and press Enter.
- The search returns records that match the search term.
- To search multiple columns, do one of the following:
- Enter the search text in each of the desired column search fields and press Enter.
- Search an individual column and then search additional columns based on the results of the first search.
- Each time you enter search criteria in a column search field and press Enter, the results will narrow.
To clear a column search:
- Delete the text in the search field for the desired column and press Enter. This returns results for any remaining column search criteria.
- Delete the text in all of the column search fields to return all records in the list.
5.3 Using Wildcards with List Searches
If you enter text in the search box without using any wildcards, the system performs the search for values greater than or equal to the value you enter. For text fields, this means that the search first sorts the records on the selected field, then finds the first record that starts with the text and all following records. For numeric fields, this means that the search finds all records where the number field ends with the entered number.
You can use wildcards to refine your search. The following wildcards are available:
- *searchterm: or %searchterm%: search for values that contain searchterm
- %searchterm: search for values that end with searchterm
- searchterm%: search for values that start with searchterm
- =searchterm: search for values that equal searchterm
- !*searchterm: search for values that do not contain searchterm
- !=searchterm: search for values that do not equal searchterm
Administrators can add a property to perform a default contains search instead of a greater than search. To make this change, add the property glide.ui.goto_use_contains (it is not available by default) and set the property value to true.
6 Boolean Operators
Boolean operators combine search terms with logic operators. The following searches support boolean operators:
- Global text search
- Knowledge base
- Lists (text searches of all fields)
For these searches, the AND operator is applied by default, which means if no Boolean operator is entered between two terms, the AND operator is used. For knowledge base searches, if the AND search returns poor results, the search is automatically re-run with the OR operator. Administrators can configure the knowledge base search to always use OR by modifying the glide.knowman.search.operator property.
|Note: Boolean operators are case-sensitive. For example, OR is an operator while or is a search term that may be a stop word.|
OR or vertical bar symbol (|)
Finds a match if either of the terms exist in a document (a union using sets). For example, to find documents that contain either "email password" or just "email", search for:
"email password" OR email
"email password" | email
When you use filter lists on keywords, OR and | produce the same results. However, using the .or. operator, which the system uses when you build conditions with the choice lists, can produce different results.
For example, these two filters produce the same result:
But this filter produces a different result:
Finds a match if both terms exist in a document (an intersection of sets). For example, to find documents that contain "CPU load" and "10 minutes", search for:
"CPU load" AND "10 minutes"
NOT, minus (-), or exclamation point (!)
Excludes documents that contain the term after NOT (a difference of sets). For example, to find documents that contain "CPU load" but not "10 minutes", search for:
"CPU load" NOT "10 minutes"
"CPU load" -"over 10"
The NOT operator cannot be used with just one term. For example, the following search returns no results:
NOT "10 minutes"
NOT must be a stand-alone word. For example:
Minus and exclamation point must immediately precede the excluded term. For example:
7 Searching for Attachments
Searches return matches in attachments when the attachment indexing option is enabled for the table you are searching. By default, this option is enabled for the knowledge base. Administrators can enable or disable this option for any table.
8 Searching with International Character Sets
Zing indexes the full range of Unicode characters to provide i18n support for searches.
8.1 How Zing Analyzes Characters
For Zing indexing and queries, documents are treated as a sequence of words. Words may be a single character (typical for Chinese and Japanese pictograms), or they may be space-separated sequences of letters (typical of Latin, Arabic, and Pinyin languages).
When dividing a document into words, Zing uses the following rules to interpret Unicode characters.
- Punctuation: Some punctuation and symbols are indexed in special cases (see How Punctuation Affects Search Results). In all other cases, punctuation characters are converted to spaces. Spaces define the basic unit of word separation.
- Pictograms: Each Chinese or Japanese pictogram is indexed as a separate word (as if it were a single Latin-1 character surrounded by spaces).
- Letter: All other characters (such as Latin-1, Arabic, or Pinyin) are individual letters of space separated words. Sequences of letters define indexable words.
8.2 Wildcards and i18n
Wildcard text searches (with "*" and "%") are only effective with multiple character words. A wildcard within a sequence of pictogram characters returns too many options for an efficient search. Wildcards are best used with letter-based words.
8.3 Stemming and i18n
During queries, search terms that are not part of phrases (not enclosed in quotation marks) are generalized to their "stemmed" word. Stemming removes a variety of common inflections, such "-s", "-es", "-ing", or "-ed". All words with a common stem are treated as synonyms of the original search term. Zing uses the Porter stemmer, which is most effective for English text.
9 Searching HTML Content
The ServiceNow system indexes the following elements in HTML tags starting with the Eureka release. Other HTML codes are not indexed.
- Title attributes: In any HTML tag, the title attribute, which is a different element than the title HTML tag.
- Anchor link targets: In any anchor link that specifies an href, the linked-to URL.
- Alt text for images: In any image element, the alternative text for screen readers.
10 How Punctuation Affects Search Results
Zing uses select punctuation symbols to improve search results. For example:
- Apostrophes ('): ignores trailing possessives and retains most others. For example, a search for O'Reilly's locates matches to O'Reilly and O'Reilly's.
- IP addresses: locates numbers that follow a typical IP address pattern.
- Numbers: locates terms that follow a typical product or record number pattern. To meet this pattern, search terms must contain frequent numbers and only these punctuation characters: underscores (_), hyphens (-), or periods (.). For example, a search for INT123-456 locates exact matches to the search term.
- Acronyms: locates acronyms whether they are separated by periods (.) or not. For example, a search for u.s.a. locates matches to usa or u.s.a.. Note that wildcard searches may affect acronym handling. For example, a search for u.s.* may yield better results than a search for u.s*.
- Company names: locates terms containing punctuation characters that are common in company names: ampersands (&), plus signs (+), or hyphens (-). For example, a search for RM&S locates exact matches to the search term.
- Host names: locates sequences of letters and numbers separated only by periods (.). For example, a search for en.myhost123.com locates exact matches to the search term.