Enabling ElasticSearch for Code Search
-
Install ElasticSearch version 7.16.2
-
Add the following configuration to GitFlic's application.properties file:
application.properties
# Enable ElasticSearch integration gitflic.elasticsearch.enabled=true # ElasticSearch server address elasticsearch.rest.uri=#ElasticSearch_server_address # Authentication credentials elasticsearch.rest.username=#ElasticSearch_username elasticsearch.rest.password=#ElasticSearch_password # Connection settings elasticsearch.rest.useSsl=false elasticsearch.rest.connection-timeout=1 elasticsearch.rest.read-timeout=30
-
Restart GitFlic to apply changes
-
Uncomment the following lines in the
external.env
file:external.env
# Enable ElasticSearch ENABLE_ELASTIC=true # ElasticSearch host ELASTIC_HOST=elasticsearch
-
Start GitFlic containers including the elasticsearch configuration:
docker compose --detach \ -f docker-compose.yaml \ -f docker-compose.elastic.yaml \ --env-file .env up
ElasticSearch is enabled by default in the Kubernetes chart.