Elasticsearch: Add merge request title suggester
Description
This is the first merge request to support merge request search-as-you-type for GitLab Duo. Here, we create a new field for the suggester (title_suggester
) with a recommended analyzer and tokenizer.
This adds the following mapping:
"title_suggester" : {
"type" : "completion",
"analyzer" : "title_suggester_analyzer",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50,
"contexts" : [
{
"name" : "project_id",
"type" : "CATEGORY"
}
]
}
NOTE: We can only use one context because they work as an OR
, see this comment for details.
Backfill migration runtime: !165177 (comment 2098341089).
Elasticsearch reference: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html
Related to #479051 (closed)
Edited by Arturo Herrero