If you want to make your GitLab search really powerful you can get it use the Elasticsearch.
_**Note:** This feature was [introduced][ee-109] in GitLab EE 8.4._
Elasticsearch is a flexible, scalable and powerful search service. It will keep to be a fast even with huge amount of data. We use elasticsearch to search through a merge requests, issues, notes, wiki, code and commits. Once the data is added to the database it will update search index automatically.
---
1. Install elasticsearch as described in the [official web site](https://www.elastic.co/products/elasticsearch). The packages are also available on different platforms.
[Elasticsearch] is a flexible, scalable and powerful search service.
1. On your GitLab server, open the configuration file.
If you want to keep GitLab's search fast when dealing with huge amount of data,
you should consider [enabling Elasticsearch](#enable-elasticsearch).
For omnibus package:
GitLab leverages the search capabilities of Elasticsearch and enables it when
searching in:
```sh
sudo editor /etc/gitlab/gitlab.rb
```
- GitLab application
- issues
- merge requests
- milestones
- notes
- projects
- repositories
- snippets
- wiki repositories
For installations from source:
Once the data is added to the database, search indexes will be updated
automatically. Elasticsearch can be installed on the same machine that GitLab
is installed or on a separate server.
```sh
cd /home/git/gitlab
## Install Elasticsearch
sudo -u git -H editor config/gitlab.yml
```
Providing detailed information on installing Elasticsearch is out of the scope
of this document.
1. Add the elastic search configuration:
You can follow the steps as described in the [official web site][install] or
use the packages that are available for your OS.
For omnibus package:
## Enable Elasticsearch
```ruby
gitlab_rails['elasticsearch'] = [
{
"enabled" => "true",
"host" => "localhost",
"port" => 9200
}
]
```
In order to enable Elasticsearch you need to have access to the server that
GitLab is hosted on.
For installation from source:
The following three parameters are needed to enable Elasticsearch:
```
elasticsearch:
enabled: true
host: localhost
port: 9200
```
| Parameter | Description |
| --------- | ----------- |
| `enabled` | Enables/disables the Elasticsearch integration. Can be either `true` or `false` |
| `host` | The host where Elasticsearch is installed on. Can be either an IP or a domain name which correctly resolves to an IP. It can be changed in the [Elasticsearch configuration settings][elastic-settings]. The default value is `localhost` |
| `port` | The TCP port that Elasticsearch listens to. It can be changed in the [Elasticsearch configuration settings][elastic-settings]. The default value is `9200` |
### Enable Elasticsearch in Omnibus installations
Chose you own configuration parameters.
If you have used one of the [Omnibus packages][pkg] to install GitLab, all
you have to do is edit `/etc/gitlab/gitlab.rb` and add the following lines:
1. Save the configuration file.
```ruby
gitlab_rails['elasticsearch']=[
{
"enabled"=>"true",
"host"=>"localhost",
"port"=>9200
}
]
```
1. Restart GitLab for the changes to take effect.
Replace the values as you see fit according to the
[settings table above](#enable-elasticsearch).
1. And the last step it to index everything by running special rake tasks.
To index all your repositories you should run following tasks:
Save the file and reconfigure GitLab for the changes to take effect: