TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Search

Last modified: 20 April 2023

After you have installed and started running TeamCity, it collects the information on builds, tests and so on and indexes it. In TeamCity you can search builds by build number, tag, build configuration name and other different parameters specifying one or several keywords and use Lucene search query syntax to get more precise results.

For complete list of available search fields (keywords) please refer to CompleteListofAvailableSearchFields section.

Search Query



In TeamCity you can search for builds using the Lucene query syntax. Though in TeamCity search query has Differences-from-Lucene-Syntax, please refer to the Lucene documentation for complete syntax rules description. To narrow your search and get more precise results you can use available search fields - indexed parameters of each build. Please refer to the Complete-List-of-Available-Search-Fields for more details.

Differences from Lucene Syntax



When using search query in TeamCity, please pay attention to the following major differences in query syntax from Lucene native syntax:

  1. By default, TeamCity uses AND operator in query. That is, if you type in the following query: "failed @agent123", then you will get a list of all builds that have keyword "failed" in any of its search fields, and were run on build agent, which name is "agent123".

  2. By default, TeamCity uses "prefix search", not exact matching like Lucene. For example, if you search for "c:main", TeamCity will find all builds of the build configuration which name starts with "main" string.

Performing Fuzzy Search



You also have a possibility to perform fuzzy search using the tilde, "~", symbol at the end of a single word term which to search items similar in spelling.

Boolean Operators and Wildcards Support



You can combine multiple terms with Boolean operators to create more complex search queries. In TeamCity, you can use AND, "+", OR, NOT and "-".

  • AND (same as a plus sign). All words that are linked by the "AND" are included in the search results.

    note

    This operator is used by default.

  • NOT (same as minus sign in front of the query word). Exclude a word or phrase from search results.

  • OR operator helps you to fetch the search terms that contain either of the terms you specify in the search field.

TeamCity also supports usage of "*" and "?" wildcards in the build query.

Complete List of Available Search Fields, Shortcuts, and Keywords



Search Fields



When using search keywords, use the following query syntax:

<search field name>:<value to search>

Shortcuts



In addition to above mentioned search fields, you can use two following shortcuts in your query:

Using Double-Colon



You can use double-colon sign (::) to search for project and/or build configuration by name:

  • pro::best — search for builds of configurations with the names starting with "best", and in the projects with the names starting with "pro".

  • mega:: — search for builds in all projects with names starting with "mega"

  • ::super — search for builds of build configurations with names starting with "super"

"Magic" Keywords

TeamCity also provides "magic" keywords (for the list see table below). These magic keywords are formed of the '$' sign and a word itself. The word can be shortened up to the one (first) syllable, that is, the $labeled, $l, and $lab keywords will be equal in query. For example, to search for pinned builds of the "Nightly build" configuration in the "Mega" project you can type any of the following queries:

  • configuration:nightly project:Mega $pinned

  • c:nigh p:mega $pin

  • M::night $pin