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'] = [
In order to enable Elasticsearch you need to have access to the server that
GitLab is hosted on.
The following three parameters are needed to enable Elasticsearch:
| 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
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:
```ruby
gitlab_rails['elasticsearch']=[
{
"enabled"=>"true",
"host"=>"localhost",
"port"=>9200
}
]
```
]
```
Replace the values as you see fit according to the
[settings table above](#enable-elasticsearch).
For installation from source:
Save the file and reconfigure GitLab for the changes to take effect:
`sudo gitlab-ctl reconfigure`.
```
elasticsearch:
As a last step, move on to
[add GitLab's data to the Elasticsearch index](#add-gitlabs-data-to-the-elasticsearch-index).
### Enable Elasticsearch in source installations
If you have installed GitLab from source, edit `/home/git/gitlab/config/gitlab.yml`:
```yaml
elasticsearch:
enabled:true
host:localhost
port:9200
```
```
Replace the values as you see fit according to the
[settings table above](#enable-elasticsearch).
Save the file and restart GitLab for the changes to take effect:
`sudo service gitlab restart`.
As a last step, move on to
[add GitLab's data to the Elasticsearch index](#add-gitlabs-data-to-the-elasticsearch-index).
## Add GitLab's data to the Elasticsearch index
Chose you own configuration parameters.
After [enabling Elasticsearch](#enable-elasticsearch), you must run some
special rake tasks to add GitLab's data to the Elasticsearch index.
1. Save the configuration file.
The following actions might take a while depending on how big your Git
repositories are.
1. Restart GitLab for the changes to take effect.
---
1. And the last step it to index everything by running special rake tasks.
To index all your repositories:
To index all your repositories you should run following tasks: