Solr index URL should be configured under the main "index" section

Configuration of the Solr index URL must currently be done in a
subsection, as follows:

  [index]
    type = SOLR
  [index "solr"]
    url = 127.0.0.1

Subsections are also being used for configuration of specific indexes
like the "changes_open" and "changes_closed" subsections that are used
for Lucene indexes, and are documented as "index.name.xyz".

Having the Solr URL configration under a similar subsection may cause
confusion, and it would be more intuitive to configure the URL under
the main index section, like:

  [index]
    type = SOLR
    url = 127.0.0.1

Subsections are being used for configuration of specific indexes like
the "changes_open" and "changes_closed" settings that can be specified
for Lucene indexes which are documented as "index.name.xyz"

Also add missing documentation of the URL parameter.

Change-Id: I0bd9eabbdbfa29241688c738aa5d213e726c90b0
This commit is contained in:
David Pursehouse
2014-02-06 12:01:34 +09:00
parent 331dd5f199
commit ac88c36c5d
2 changed files with 8 additions and 2 deletions

View File

@@ -1901,6 +1901,12 @@ Gerrit server.
Open and closed changes are indexed in separate indexes named
'changes_open' and 'changes_closed' respectively.
[[index.url]]index.url::
+
Only used when the type is `SOLR`.
+
URL of the index server.
[[index.name.ramBufferSize]]index.name.ramBufferSize::
+
Only used when the type is `LUCENE`.

View File

@@ -100,9 +100,9 @@ class SolrChangeIndex implements ChangeIndex, LifecycleListener {
this.indexes = indexes;
this.schema = schema;
String url = cfg.getString("index", "solr", "url");
String url = cfg.getString("index", null, "url");
if (Strings.isNullOrEmpty(url)) {
throw new IllegalStateException("index.solr.url must be supplied");
throw new IllegalStateException("index.url must be supplied");
}
// Version is only used to determine the list of stop words used by the