Developer Portal for YouTrack and Hub 2021.3 Help

Search Suggestions

Lets you get suggestions for the currently entered search query.

Resource

/api/search/assist

Returned entity

SearchSuggestions. For the description of the entity attributes, see Supported Fields section.

Supported methods

SearchSuggestions attributes

Represents the list of search suggestions for the currently entered search query.

This table describes attributes of the SearchSuggestions entity.

  • To receive an attribute in the response from server, specify it explicitly in the request parameter fields.

  • To update an attribute, provide it in the body of a POST request.

Field

Type

Description

caret

Int

The current caret position. The end of the current search query by default.

ignoreUnresolvedSetting

Boolean

When false, the Hide unresolved issues setting is taken into account for creating search suggestions. When true, this setting is ignored. True when the currently entered search query concerns a state-type field.

query

String

The current search query for which the suggestions are being requested. Can be null.

suggestions

Array of Suggestions

The list of search suggestions for the currently entered search query. Read-only.

folders

Array of IssueFolders

The current search context.

Read Search Query Suggestions

Get search query suggestions for the currently entered search query.

Request syntax

POST /api/search/assist?{fields}

Request parameters

Parameter

Type

Description

fields

String

A list of SearchSuggestions attributes that should be returned in the response. If no field is specified,only the entityID is returned

Sample

Sample request

https://example.myjetbrains.com/youtrack/api/search/assist?fields=caret,query,suggestions(caret,completionEnd,completionStart,description,group,matchingEnd,matchingStart,option)

Sample request body

{ "query": "tag: " }

Sample response body

{ "caret": 5, "suggestions": [ { "group": null, "completionStart": 5, "completionEnd": 5, "matchingStart": 0, "matchingEnd": 0, "caret": 6, "description": "exclude value", "option": "-", "$type": "Suggestion" }, { "group": null, "completionStart": 5, "completionEnd": 5, "matchingStart": 0, "matchingEnd": 0, "caret": 29, "description": "tag", "option": "Blocked by dependency", "$type": "Suggestion" }, { "group": null, "completionStart": 5, "completionEnd": 5, "matchingStart": 0, "matchingEnd": 0, "caret": 14, "description": "empty list of tags", "option": "no tag", "$type": "Suggestion" }, { "group": null, "completionStart": 5, "completionEnd": 5, "matchingStart": 0, "matchingEnd": 0, "caret": 10, "description": "tag", "option": "Star", "$type": "Suggestion" }, { "group": null, "completionStart": 5, "completionEnd": 5, "matchingStart": 0, "matchingEnd": 0, "caret": 9, "description": "tag", "option": "tip", "$type": "Suggestion" }, { "group": "Recent Searches", "completionStart": 0, "completionEnd": 5, "matchingStart": 0, "matchingEnd": 5, "caret": 10, "description": " ", "option": "tag: Star", "$type": "Suggestion" } ], "query": "tag: ", "$type": "SearchSuggestions" }
Last modified: 14 September 2021