Single Term Search Optimization
Text search in YouTrack is based on stemming, also known as morphological analysis. It lets you find issues that contain all forms of the words that you enter in a search query. The downside of stemming is its inability to return issues that only contain the specified word form.
The Single Term Search Optimization feature assigns higher relevance scores to words that exactly match the specified word form in text searches that contain single terms. As a result, it's easier to find issues that contain words that exactly match single terms in search queries.
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 results are sorted by relevance.
The query returns 29395 issues. This includes issues that contain all word forms that are similar to
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 quotation marks:
"documenting". The query only returns 72 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 issue that contain the specified word form.
Note that all word forms that are similar to the specified term are highlighted in the results, not just exact matches.
Optimizations for Phrase Search
This optimization only applies to single search terms, not phrases. If you want to find issues that contain a particular phrase, you can either:
Search for the phrase and sort the results by relevance (just as you would prior to the release of this feature). 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
ANDoperator 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 feature 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 parsed as words and do not benefit from the optimization for single terms. The ability to return exact matches for arbitrary strings will be delivered as a separate feature in an upcoming release.
Disabling Single Search Term Optimization
The Single Search Term Optimization feature is enabled by default. Our development team has tested the feature extensively and has not observed any significant impact on performance. By making this feature available to all users, we hope to gather additional information and identify special cases where the feature may have adverse effects.
The execution speed for search queries is affected by the size of your text index. The text index increases in size based on the total number of terms that are stored in your issues for each indexed language. If your issues cover a wide range of topics and are reported and indexed in multiple languages, your execution time for search queries may be slow. The optimization for single search terms may increase execution time.
If you find that search execution becomes unbearably slow after you upgrade to YouTrack 2018.4, you can disable this feature. For instructions, see Manage Experimental Features.