Advanced Search: Unexpected results when having `-` in the search term
It seems like our current mappings for gitlab-production
do not work properly with the -
symbol. Specifically, the content
field
indexes :content, type: :text,
index_options: 'positions',
analyzer: :code_analyzer,
search_analyzer: :code_search_analyzer
How to reproduce the problem
Create a file with this content:
extends: .gitlab-tests-image
If you search for the entire term gitlab-tests-image
, advanced search returns results. If you search for tests-image
or gitlab-tests
, you won't get hits.
Release notes
This release includes a Code Search quality improvement for Advanced Search which brings it closer to the local IDE experience. We expect improved relevance when searching for full tokens and some partial tokens as well as better matching for search terms with special characters.
Please note that if your index is created before GitLab 15.5, you'll need to update mappings. In order to do that you can use Zero downtime reindexing or re-create your Advanced Search index from scratch.