Add a new zoekt admin setting maxNumberFiles
What does this MR do and why?
This change adds a new feature in GitLab 18.2 that allows administrators to set a maximum limit on the number of files in a project that can be indexed for exact code search. The default limit is set to 500,000 files, and any project with more files in its default branch will be skipped during indexing. The feature helps manage server performance by preventing extremely large projects from overwhelming the indexing system. Administrators can adjust this limit through the Admin Settings > Search interface, and the value must be greater than zero. The implementation includes updates to the UI, backend settings, validation, and documentation to support this new configuration option.
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Visit http://127.0.0.1:3000/admin/application_settings/search#js-exact-code-search-settings
- Try to set the value for
Maximum number of files in a project to be indexed. Verify it gets persisted. Valid values are any natural numbers - Try to set some invalid value and verify that you will get an error and will not overwrite the previous value. Invalid values, eg,
0
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #539523 (closed)

