Include an 'Accept' header for Content-Type in requests

We always expect a Content-Type of 'application/json' with a charset of
UTF-8, so we should include that in our request headers. Also improve
the response parsing to use the ContentType helper and ignore case for
compatibility with newer Elasticsearch versions.

Change-Id: I11984a49f0487dc1b8c979c503d3124cf3aa9c50
2 files changed
tree: f1f27ca569239e088155dd508ef8d98d0ab02e92
  1. src/
  2. BUILD
  3. external_plugin_deps.bzl
  4. Jenkinsfile
  5. LICENSE
  6. README.md
README.md

Index backend for Gerrit, based on ElasticSearch

Indexing backend libModule for Gerrit Code Review based on ElasticSearch.

This module was originally part of Gerrit core and then extracted into a separate component from v3.5.0-rc3 as part of Change-Id: Ib7b5167ce.

Note that, ElasticSearch source code is no longer Apache 2.0-licensed for versions 7.11 and newer. See ElasticSearch 2021 license change for more information.

How to build

This libModule is built like a Gerrit in-tree plugin, using Bazelisk. See the build instructions for more details.

Setup

See the setup instructions for how to install the index-elasticsearch module.

For further information and supported options, refer to the config documentation.

Integration test

This libModule runs tests like a Gerrit in-tree plugin, using Bazelisk. See the test instructions for more details.