Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As an example benchmark, Smarter Search for Bitbucket indexed the Linux code base which is approximately 15 million lines of code and half a million commits in 2-3 minutes with 6 GB of ram on non-SSD hard drives with an internal node. That said, it is recommended that for large codebases you use an external Elasticsearch node. For any concerns or questions, feel free to contact us.

External Node

For Bitbucket instances with large codebases and a lot of indexing, it's recommended to setup a separate Elasticsearch service. This will reduce the strain on Bitbucket for indexing, and should significantly improve performance. You can configure an external node in the settings page.

...

After installing the plugin in your bitbucket instance, you must enable indexing and trigger a reindex:

  1. Go to Smarter Search for Bitbucket Global Settings page in the Bitbucket admin panel.

  2. Enable Indexing by clicking the check box.

  3. Click Save and Reindex to save the settings and subsequently reindex all repositories.

External Node (Elasticsearch 2.4.6)

Plugin requires groovy script support but it’s not enabled by default. So Elasticsearch config file (elasticsearch.yml) like below is required:

Code Block
languageyaml
cluster.name: stash-codesearch
network.host: 0.0.0.0 # if network access is required
script.inline: on
script.indexed: on
script.engine.groovy.inline.update: on
script.engine.groovy.inline.aggs: on
index.query.bool.max_clause_count: 10240

Besides changes above Delete By Query plugin needs to be installed.

You can use the command:

Code Block
languagebash
plugin install delete-by-query

External Node (Elasticsearch 2.1.1)

You must first setup an external Elasticsearch cluster. For help on that, look here. Make sure you install the Delete By Query plugin as well. The scripts we've included will do this for you. Smarter Search for Bitbucket has a configuration page in the global settings to use to point to your Elasticsearch instance.

...

Once the node is setup, you must configure Smarter Search for Bitbucket:

  1. Go to Smarter Search for Bitbucket Global Settings page in the Bitbucket admin panel.

  2. Enable Indexing by clicking the check box.

  3. Uncheck the Internal ES Node checkbox.

  4. Click Save and Reindex to save the settings and subsequently reindex all repositories.

Smarter Search for Bitbucket will then start indexing all of your bitbucket repositories in the background. It will take a few seconds to a few minutes to finish depending on the number and size of your repositories. For large Bitbucket instances, it is recommend indexing to be done during non peak hours.

By default, only the master and develop branches are indexed. Individual repo admins may modify these settings. See the Administration documentation page for instructions.