How to configure Gitlab Advanced Search ======================================= Published : 1 January 2025 Reading : 2 min Tags : gitlab URL : https://ctrl-find.nl/posts/gitlab_advanced_search/ Plain text : https://ctrl-find.nl/posts/gitlab_advanced_search/index.txt ------------------------------------------------------------ ## Docker-compose elastic setup This guide is based on docker-compose setup from elasticsearch. ## Add the Elastic IP Add the IP and DNS from docker host to Gitlab. ```bash vi /etc/hosts ``` ```bash < DNS name like: test0.internal test1.internal test2.internal> ``` ## Add Elastic CA certificate Add the CA certificate to `/etc/gitlab/trusted-certs` (give it a logical name) This CA file can be found on the docker host in the mapped data location. ## Run Gitlab reconfigure The reconfigure will add the CA to gitlab internally. ```bash gitlab-ctl reconfigure ``` This will make a specific hash symlink in another gitlab folder. ```text /opt/gitlab/embedded/ssl/certs ``` This will show if openssl can make a connection to the Elasticsearch cluster ```bash echo | /opt/gitlab/embedded/bin/openssl s_client -connect test0.internal:9200 ``` With the symlink in place we can configure through the GUI the connection to Elasticsearch cluster with with username and password. ## Rate Limiting change The default rate limit is set to 30, when using advanced search the rate limit will be triggerd per minute. Through the following change we set the new default to 1000. This can be set through following path in UI: admin portal > settings > Network > Search rate limits ## Indexing shard sizing Through the GUI we can setup our Shard sizing, after testing 1 shard and 1 replica is more then enough for our needs. ## Indexing Input parameters for connection; url: Username: elastic Password: Configured Password Enable setting "Elasticsearch indexing", Press the blue button on top off the page to start the indexing from all the projects. Progress can be found throughout the CLI commands below; ## Enabling Advance Search Enable setting "Search with Elasticsearch enabled" ## Nice to know commands ### Create and recreate index for Elastic through gitlab-rake ```bash gitlab-rake gitlab:elastic:create_empty_index gitlab-rake gitlab:elastic:recreate_index ``` ### Index information ```bash gitlab-rake gitlab:elastic:projects_not_indexed gitlab-rake gitlab:elastic:index_projects gitlab-rake gitlab:elastic:index_projects_status ``` ### Gitlab Elastic main overview ```bash gitlab-rake gitlab:elastic:info ``` ------------------------------------------------------------ NAVIGATION [index] https://ctrl-find.nl/posts/index.txt [<< prev] How to do a Gitlab Major version upgrade https://ctrl-find.nl/posts/gitlab_upgrade/index.txt [next >>] Gitlab locked login backdoor https://ctrl-find.nl/posts/gitlab_backdoor/index.txt ------------------------------------------------------------ CTRL-Find — Debugging all systems https://ctrl-find.nl/