Text Search
YouTrack lets you search for issues that contain specific words and phrases. You can either search for text in all issue attributes, or limit the search query to find text in the issue summary, description, comments, or work items. You can also limit the search to search for words in lines of code. For more information, see Issue Attributes.
YouTrack supports several strategies that help you find just what you're looking for.
Standard Text Search
Any input that is not parsed as an attribute-based search and is not set in single quotes is parsed as standard text search. Standard text search is case-insensitive.
Consider this example where the query is written as follows:
project: YouTrack Priority: Major Type: Bug State: in progress
When you search for a value in an attribute that contains spaces, you need to set the value in braces. If you don't follow this rule, the first word in the value is parsed as the value for the attribute that precedes it. Any word that follows is parsed as text.
The highlighting in this search query shows that the word in
has been parsed as a value for the State field, which is invalid. The word progress
is not highlighted and has been parsed as text.
Follow these guidelines to search for text in a query:
Enter a single term to find issues that contain matching forms for this word.
If the language has been indexed, YouTrack also returns issues that contain morphological variants of the specified word or words.
Enter multiple words to find issues that contain all the specified words in any order.
Use wildcards to expand the text search to include characters that do not exactly match your search criteria.
For more information, see Wildcards in Text Search.
If you do not specify which attribute to search in, YouTrack returns all issues that contain matching words and their morphological variants in any attribute, including custom fields. To learn how to restrict the results to issues that contain matching text in specific issue attributes, see Text Attributes.
If standard text search doesn't return the issue or issues you were looking for, try one of the following strategies:
Set words, phrases, or strings of characters in single quotes.
This syntax returns issues that contain exact matches for the specified string. To learn more, see Exact Match Search.
Set single terms in quotation marks to find issues that contain exact matches for the specified word form.
To learn more about how YouTrack handles searches that contain single terms, see Searching for Single Terms.
Set multiple terms in quotation marks to find issues that contain words as a phrase.
A phrase is defined as a consecutive grouping of word forms that match the text in the search query and appear in the same order. If the phrase contains a stop word, the stop word is replaced by any word in the issue.
To learn more about how YouTrack searches for phrases, see Searching for Phrases.
Exact Match Search
You can search for issues that contain exact matches for an arbitrary string of characters.
This string can be anything from a particular word form to a sequence of random characters. This type of search ignores morphological variants for specified words, stemming, phrases, stop words, and other natural language features that are supported in standard text search.
Exact match search queries differ from standard text search in the following ways:
Exact match search is case sensitive. Text search queries are case insensitive.
With exact match search queries, you can't limit the results to issues that contain matching strings in a specified issue attribute. The search results include all issues that contain the matching string in any issue attribute that stores values as text.
To find issues that contain exact matches for a specified string, wrap the string in single quotes. For example:
Searching for
'[i]++'
returns any issue that contains a string of characters [i]++ in any issue attribute (probably in a code snippet or stack trace).You can find issues that contain specific misspellings of single words, like
'JetBrainz'
.
Searching for Single Terms
To find issues that contain a word in a particular form, you have two options:
Specify the word that you want to find in your search query and sort the results by relevance. Issues that contain the word in the specified form appear at the top in the results. Issues that contain other forms of the specified term appear lower in the list.
Set the single term in quotation marks. With this syntax, the search results only contain exact matches for the specified word form. Other forms of the specified word are excluded from the results.
Compare the difference between the search results for these two search queries.
The search query in this example includes the single term documenting
.
The query returns 166,646 issues. This includes issues that contain all word forms that are similar to documenting
, like document
amd documentation
. However, when the results are sorted by relevance, issues that contain the word documenting
appear higher in the list. Exact matches in the issue summary are assigned higher relevance scores than matches in other issue fields.
In this example, the single term is set in single quotes: 'documenting'
. The query only returns 315 issues. Issues that only contain word forms that are similar to documenting
are excluded from the results.
The results here are sorted by last update, so you don't see issues that include the specified word form in the issue summary at the top of the list. However, every issue in this list contains an exact match for the word documenting
somewhere in the issue, including comments and custom fields. You can sort the results by any other attribute and still find only issues that contain the specified word form.
The search query in this example includes the single term documenting
. The results are sorted by relevance.
The query returns 23,951 issues. This includes issues that contain all word forms that are similar to documenting
, like document
amd documentation
. However, when the results are sorted by relevance, issues that contain the word documenting
appear higher in the list. Exact matches in the issue summary are assigned higher relevance scores that matches in other issue fields.
In this example, the single term is set in single quotes: 'documenting'
. The query only returns 120 issues. Issues that only contain word forms that are similar to documenting
are excluded from the results.
The results here are sorted by last update, so you don't see issues that include the specified word form in the issue summary at the top of the list. However, every issue in this list contains an exact match for the word documenting
somewhere in the issue, including comments and custom fields. You can sort the results by any other attribute and still find only issues that contain the specified word form.
Searching for Phrases
YouTrack processes searches for multiple terms that are set in quotation marks as a phrase. Issues that are returned by a phrase search contain matching forms for all the words that are specified in the query that appear in the specified order.
If you enter a stop word in a phrase, it's handled as if it were a wildcard and can be replaced by any word in the search results. For more information, see Stop Words.
The search results for queries that specify a phrase will contain morphological variations for each word in the phrase. If you want to find issues that contain exact matches for a particular phrase, you can either:
Search for the phrase and sort the results by relevance. Issues that contain word forms that exactly match the words in the phrase appear higher in the list.
Build a query that specifies each word from the phrase in its desired form, using the
AND
operator between each term. For example,"documenting" AND "source" AND "code"
. As long as the phrase doesn't contain any stop words, this workaround helps you find an exact match for a phrase.
This workaround doesn't support exact matches for all terms and phrases. For example, if you want to find issues that contain code constructions like [i]++
, you won't find many matches in the search results. That's because strings like this are not indexed and parsed as words.
Text Attributes
You can limit the search to find words in the issue summary, description, comments, attachment filenames, or inside code blocks. These attributes store data as strings as text.
When you specify a text attribute, the query is executed as text search. Instead of searching for an exact match for the specified value, YouTrack returns issues that contain matching word forms inside the string of text that is stored in the specified attribute.
For example, the query Subsystem: {Agile Board}
returns only issues that are assigned the value Agile Board in the Subsystem field. This is an attribute-based search and returns only exact matches. The query description: "Agile Board"
returns any issue that contains matches for the words "Agile Board" as a phrase in the issue description. This is a text search and returns possible matches in the specified attribute. The results include issues with descriptions that contain other variants like "agile boards".
Search queries that reference the following attributes are executed as text search:
Queries that reference supplemental text fields are also executed as text search.
Sorting by Relevance
When you perform a text search, the results can be sorted by relevance. This sort option can be applied to search results under the following conditions:
The search query contains at least one string that is parsed text search. This includes attribute-based search queries that search for text matches in the summary, description, comments, attachment filenames, and code.
The search query does not contain an explicit sort attribute. The explicit sort attribute overrides the default sort by relevance.
The search query does not contain an
OR
expression.
Results can also be sorted by relevance for saved searches that meet this criteria. However, if the saved search stores a custom order, the custom order overrides sorting by relevance.
Issues that have been ordered manually appear in the custom order.
Issues that have not been ordered manually are sorted by last update.
Relevance is normally applied as the default sort order to the search results for queries that search for text. If you want to order the search results differently, you have a few options:
Use the Sort Attributes menu to override sorting the results by relevance. To open this menu and select another search attribute, click the current sort attribute. This adds the selected sort attribute explicitly to the current query.
You can discard any explicit sort attributes by removing them from the Sort Attributes menu or manually deleting them from the query string. When you remove all the explicit sort attributes, the search results are once again sorted by relevance.
Switch the default sorting for text search in your YouTrack profile.
In your YouTrack profile, there is a setting that lets you choose whether the results for text searches are sorted by relevance or last update. When set to Updated, results that would otherwise be sorted by relevance are sorted by last update instead. The option to sort the results by relevance is no longer available. To sort any search results by relevance, you need to switch this setting back to Relevance.
This option is mostly intended to let users disable sorting by relevance. If you find that there are some queries where you would prefer to sort by last update and others where relevance is more appropriate, we suggest that you keep Relevance as the default setting and override this sort order where needed by adding explicit sort attributes to the search query.
To learn more about the preference options in your YouTrack profile, see General Profile Settings.
The sorting options that are currently applied to the search results are always displayed directly under the search box.
Relevance is based on the number of matching word forms that are found in each issue. Matches in the issue summary are given a slightly higher weight than matches in other issue attributes. Issues with multiple matches in the description, comments, or other issue attributes will have higher relevance than issues with a single match in the summary.
Wildcards in Text Search
You can use wildcards as a placeholder for one or more characters.
*
— matches zero or more characters in a string. When placed at the beginning or end of a word, the search returns matches for words with any prefix or suffix, respectively.For example, a search for
*view
will return issues that contain the wordsview
,review
,overview
,preview
,purview
, and so on.You can also use this wildcard at the end of a value in an attribute-based search. For more information, see Wildcards in Attribute-based Search.
?
— matches any single character in a string. You can only use this wildcard to search in text attributes. You cannot use this wildcard to search for values in custom fields, even when the field store values as astring
type.
You can use a wildcard at the beginning, middle, or end of any word.
Stop Words
If you use English as the default language in YouTrack, there are a number of common words that are filtered out before the search query is processed. These are called stop words. These words are removed to improve query performance. Stop words are handled as follows:
If you use a stop word as a single search term, it is ignored.
If you enter a stop word in a phrase, it's handled as if it were a wildcard and can be replaced by any word in the search results.
Stop words are not highlighted in the search results.
The following stop words are ignored by YouTrack:
a | an | and | are | as | at | be | but | by | for | if |
in | into | is | it | no | not | of | on | or | such | that |
the | their | then | there | these | they | this | to | was | will | with |
Search Results
The list of issues that is displayed when you use text search highlights all word forms that match the words that are specified in the query.
When you search for a phrase, the query returns only issues that contain forms for each word in the specified order. Word forms that match any of the specified words are highlighted in the results. At first glance, you may think that the search has returned issues that don't match your query. If you open each issue, however, you can see that the issue contains the sequence of words that match your search criteria.
If your text search returns too many issues, use additional search parameters to limit the results to a specific project, subsystem, or issue type. You can also limit the results to show issues that include the text only in the summary, description, or comments.
Stemming
If text indexing is enabled for the language that you use in YouTrack, related words are mapped to a common stem word. When you search for text, YouTrack returns issues that contain all forms of the words that you enter in a search query. For example, the search query description: {search attribute}
returns not only issues that contain either the words 'search' or 'attribute' in the description, but also any issue that contains other forms of these words, including 'searches', 'searched', 'searching', 'attributes', 'attribution', and so on. This feature helps you locate issues that might otherwise be excluded if the results included only exact word matches.
Text indexing is automatically enabled for all default languages. This means that stemming is enabled for all issue attributes that store strings of text in any of the languages that are provided out-of-the-box in YouTrack. For English, text indexing cannot be disabled.
For more information, see Text Index.
Tokenization
YouTrack breaks down each word in a string of text into tokens. All contiguous strings of alphabetic or numeric characters are part of one token. When you search for multiple words, the query is interpreted as a string of tokens.
When the words are set in braces, each token is evaluated separately. The search results include all issues that contain any words that match any token in the query.
When the words are set in quotation marks, the tokens are evaluated as a sequence. The search results include only issues that contain words that match all tokens in the specified order.
YouTrack returns issues that contain the words that correspond to the tokens that are specified in the search. The text in an issue is broken down into words. Whitespaces and punctuation are used to determine where the words begin and end. Periods and underscores are also recognized as delimiters.
Fuzzy Search
To find words that match an approximate pattern, instead of an exact pattern, use a fuzzy search. Fuzzy search finds words that are just a few characters off from the word that is specified in the search query. This technique helps you account for misspellings, partial words, and slight differences in names.
For example, the search query comments: {michael~}
returns issues that include not only the name Michael
in the comments but also other spellings like Mikhail
.
Fuzzy matching usually returns a large number of irrelevant matches Use this option only when you know that the word you are searching for is likely to be misspelled.