You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/02/02 17:42:49 UTC
[solr] branch jira/solr-15556-antora updated (df36ac8 -> 1b83fcc)
This is an automated email from the ASF dual-hosted git repository.
houston pushed a change to branch jira/solr-15556-antora
in repository https://gitbox.apache.org/repos/asf/solr.git.
from df36ac8 Use local javadocs (solr & lucene) when building local site
add 38421ea SOLR-15968 bin/solr zk always throws exception - change zk logging to ERROR level for SolrCLI (#586)
add bec2e20 SOLR-15966 Get rid of WEB-INF/lib/jsr305-3.0.2.jar (#582)
add 6f475f8 SOLR-15936 Reduce unnecessary startup logging, such as SSL warnings when SSL not in use (#578)
add a1ae39c SOLR-15969 Supress SimpleTextCodec on Backup Operations (#587)
add 17ea1bd SOLR-15926: Fix git links and versions in the ref guide (#548)
new 1b83fcc Merge remote-tracking branch 'apache/main' into jira/solr-15556-antora
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
solr/CHANGES.txt | 4 +
solr/core/build.gradle | 1 +
.../java/org/apache/solr/core/SolrXmlConfig.java | 2 +-
.../solr/metrics/reporters/SolrJmxReporter.java | 4 +-
.../DistributedQueryComponentCustomSortTest.java | 2 +
solr/licenses/javax.annotation-api-1.3.2.jar.sha1 | 1 -
.../licenses/javax.annotation-api-LICENSE-CDDL.txt | 362 ---------------------
solr/licenses/jsr305-3.0.2.jar.sha1 | 1 -
solr/licenses/jsr305-LICENSE-ASL.txt | 202 ------------
solr/licenses/jsr305-NOTICE.txt | 0
solr/modules/gcs-repository/build.gradle | 6 +-
.../solr/handler/TestHdfsBackupRestoreCore.java | 2 +
solr/modules/s3-repository/build.gradle | 5 +
solr/server/resources/log4j2-console.xml | 5 +-
solr/server/resources/log4j2.xml | 3 +
solr/solr-ref-guide/build.gradle | 2 +-
.../pages/package-manager-internals.adoc | 8 +-
.../pages/basic-authentication-plugin.adoc | 6 +-
.../deployment-guide/pages/docker-networking.adoc | 4 +-
.../deployment-guide/pages/installing-solr.adoc | 2 +-
.../pages/solr-control-script-reference.adoc | 2 +-
.../pages/taking-solr-to-production.adoc | 14 +-
.../getting-started/pages/tutorial-aws.adoc | 8 +-
.../getting-started/pages/tutorial-films.adoc | 10 +-
.../pages/tutorial-techproducts.adoc | 16 +-
.../pages/partial-document-updates.adoc | 2 +-
.../modules/query-guide/pages/jdbc-zeppelin.adoc | 2 +-
.../query-guide/pages/learning-to-rank.adoc | 2 +-
.../solr/client/solrj/impl/Http2SolrClient.java | 18 +-
.../cloud/AbstractBasicDistributedZk2TestBase.java | 2 +
.../apache/solr/handler/BackupRestoreUtils.java | 1 +
versions.lock | 4 +-
32 files changed, 80 insertions(+), 623 deletions(-)
delete mode 100644 solr/licenses/javax.annotation-api-1.3.2.jar.sha1
delete mode 100644 solr/licenses/javax.annotation-api-LICENSE-CDDL.txt
delete mode 100644 solr/licenses/jsr305-3.0.2.jar.sha1
delete mode 100644 solr/licenses/jsr305-LICENSE-ASL.txt
delete mode 100644 solr/licenses/jsr305-NOTICE.txt
[solr] 01/01: Merge remote-tracking branch 'apache/main' into jira/solr-15556-antora
Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
houston pushed a commit to branch jira/solr-15556-antora
in repository https://gitbox.apache.org/repos/asf/solr.git
commit 1b83fccbc2fdad47555b44837f894af95eb5d9fc
Merge: df36ac8 17ea1bd
Author: Houston Putman <ho...@apache.org>
AuthorDate: Wed Feb 2 12:39:36 2022 -0500
Merge remote-tracking branch 'apache/main' into jira/solr-15556-antora
solr/CHANGES.txt | 4 +
solr/core/build.gradle | 1 +
.../java/org/apache/solr/core/SolrXmlConfig.java | 2 +-
.../solr/metrics/reporters/SolrJmxReporter.java | 4 +-
.../DistributedQueryComponentCustomSortTest.java | 2 +
solr/licenses/javax.annotation-api-1.3.2.jar.sha1 | 1 -
.../licenses/javax.annotation-api-LICENSE-CDDL.txt | 362 ---------------------
solr/licenses/jsr305-3.0.2.jar.sha1 | 1 -
solr/licenses/jsr305-LICENSE-ASL.txt | 202 ------------
solr/licenses/jsr305-NOTICE.txt | 0
solr/modules/gcs-repository/build.gradle | 6 +-
.../solr/handler/TestHdfsBackupRestoreCore.java | 2 +
solr/modules/s3-repository/build.gradle | 5 +
solr/server/resources/log4j2-console.xml | 5 +-
solr/server/resources/log4j2.xml | 3 +
solr/solr-ref-guide/build.gradle | 2 +-
.../pages/package-manager-internals.adoc | 8 +-
.../pages/basic-authentication-plugin.adoc | 6 +-
.../deployment-guide/pages/docker-networking.adoc | 4 +-
.../deployment-guide/pages/installing-solr.adoc | 2 +-
.../pages/solr-control-script-reference.adoc | 2 +-
.../pages/taking-solr-to-production.adoc | 14 +-
.../getting-started/pages/tutorial-aws.adoc | 8 +-
.../getting-started/pages/tutorial-films.adoc | 10 +-
.../pages/tutorial-techproducts.adoc | 16 +-
.../pages/partial-document-updates.adoc | 2 +-
.../modules/query-guide/pages/jdbc-zeppelin.adoc | 2 +-
.../query-guide/pages/learning-to-rank.adoc | 2 +-
.../solr/client/solrj/impl/Http2SolrClient.java | 18 +-
.../cloud/AbstractBasicDistributedZk2TestBase.java | 2 +
.../apache/solr/handler/BackupRestoreUtils.java | 1 +
versions.lock | 4 +-
32 files changed, 80 insertions(+), 623 deletions(-)
diff --cc solr/solr-ref-guide/modules/deployment-guide/pages/basic-authentication-plugin.adoc
index 2d72999,0000000..e649f4a
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/basic-authentication-plugin.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/basic-authentication-plugin.adoc
@@@ -1,362 -1,0 +1,364 @@@
+= Basic Authentication Plugin
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+Solr can support Basic authentication for users with the use of the `BasicAuthPlugin`.
+
+This plugin only provides user authentication.
+To control user permissions, you may need to configure an authorization plugin as described in the section xref:rule-based-authorization-plugin.adoc[].
+
+== Enable Basic Authentication
+
+To use Basic authentication, you must first create a `security.json` file.
+This file and where to put it is described in detail in the section xref:authentication-and-authorization-plugins.adoc#configuring-security-json[Configuring security.json].
+
+If running in cloud mode, you can use the `bin/solr auth` command-line utility to enable security for a new installation, see: `bin/solr auth --help` for more details.
+
+For Basic authentication, `security.json` must have an `authentication` block which defines the class being used for authentication.
+Usernames and passwords (as a sha256(password+salt) hash) could be added when the file is created, or can be added later with the Authentication API, described below.
+
+An example `security.json` showing `authentication` and `authorization` blocks is shown below to show how authentication and authorization plugins can work together:
+
+[source,json]
+----
+{
+"authentication":{ <1>
+ "blockUnknown": true, <2>
+ "class":"solr.BasicAuthPlugin",
+ "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, <3>
+ "realm":"My Solr users", <4>
+ "forwardCredentials": false <5>
+},
+"authorization":{
+ "class":"solr.RuleBasedAuthorizationPlugin",
+ "permissions":[{"name":"security-edit",
+ "role":"admin"}],
+ "user-role":{"solr":"admin"}
+}}
+----
+
+There are several options defined in this example:
+
+<1> The first block defines the authentication plugin to be used and its parameters.
+<2> The parameter `"blockUnknown":true` means that unauthenticated requests are not allowed to pass through.
+<3> A user called 'solr', with a password `'SolrRocks'` has been defined.
+<4> We override the `realm` property to display another text on the login prompt.
+<5> The parameter `"forwardCredentials":false` means we let Solr's PKI authenticaion handle distributed request instead of forwarding the Basic Auth header.
+
+Save your settings to a file called `security.json` locally.
+If you are using Solr in single-node installation, you should put this file in `$SOLR_HOME`.
+
+If `blockUnknown` is not defined in the `security.json` file, it will default to `true`.
+This has the effect of requiring authentication for HTTP access to Solr.
+In some cases, you may not want authentication after enabling the plugin; for example, if you want to have `security.json` in place but aren't ready to enable authentication.
+However, you will want to ensure that `blockUnknown` is set to `true` or omitted entirely in order for authentication to be enforced for all requests to your system.
+
+[WARNING]
+====
+If you set `blockUnknown` to `false`, then *any* request that is not explicitly protected by a permission will be accessible to anonymous users!
+Consequently, you should define a role binding for every xref:rule-based-authorization-plugin.adoc#permissions[predefined permission] you want to protect.
+You can assign the special `role: null` binding for requests that you want to allow anonymous users to access. To protect all endpoints except those with `role:null`,
+you can add a role binding for the `all` permission and place it in the last position in `security.json`.
+====
+
+If `realm` is not defined, it will default to `solr`.
+
+If you are using SolrCloud, you must upload `security.json` to ZooKeeper.
+An example command and more information about securing your setup can be found at xref:authentication-and-authorization-plugins#in-a-solrcloud-cluster[Authentication and Authorization Plugins In a SolrCloud Cluster].
+
+=== Caveats
+
+There are a few things to keep in mind when using the Basic authentication plugin.
+
+* Credentials are sent in plain text by default.
+It's recommended to use SSL for communication when Basic authentication is enabled, as described in the section xref:enabling-ssl.adoc[].
+
+* A user who has access to write permissions to `security.json` will be able to modify all permissions and user permission assignments.
+Special care should be taken to only grant access to editing security to appropriate users.
+
+* Your network should, of course, be secure.
+Even with Basic authentication enabled, you should not unnecessarily expose Solr to the outside world.
+
+== Combining Basic Authentication with Other Schemes
+:experimental:
+
+When using other authentication schemes, such as the xref:jwt-authentication-plugin.adoc[], you may still want to use Basic authentication for a small set of "service account" oriented client applications.
+Solr provides the `MultiAuthPlugin` to support multiple authentication schemes. For example, you may want to integrate Solr with an OIDC provider for user accounts,
+but also use Basic for authenticating requests coming from the Prometheus metrics exporter. The `MultiAuthPlugin` uses the scheme of the `Authorization` header to determine which
+plugin should handle each request. The `MultiAuthPlugin` is useful when running Solr on Kubernetes as you can delegate user management and authentication to an OIDC provider for end-users,
+but also secure the liveness and readiness endpoints using `Basic` authentication, as you would not want Kubernetes to use OIDC when testing the probe endpoints.
+
+The following example illustrates how to configure the `MultiAuthPlugin` to support the `Basic` and `Bearer` schemes.
+
+[source,json]
+----
+{
+ "authentication": {
+ "class": "solr.MultiAuthPlugin",
+ "schemes": [{
+ "scheme": "bearer",
+ "blockUnknown": true,
+ "class": "solr.JWTAuthPlugin",
+ "wellKnownUrl": "https://OIDC_PROVIDER_URL/.well-known/openid-configuration",
+ "clientId": "solr",
+ "redirectUris": "http://localhost:8983/solr/",
+ "rolesClaim": "groups"
+ },{
+ "scheme": "basic",
+ "blockUnknown": true,
+ "class": "solr.BasicAuthPlugin",
+ "credentials": {
+ "k8s-oper": "PASSWORD SALT & HASH"
+ },
+ "forwardCredentials": false
+ }]
+ }
+}
+----
+For un-authenticated AJAX requests from the Solr Admin UI (i.e. requests without an `Authorization` header),
+the `MultiAuthPlugin` forwards the request to the first plugin listed in the `schemes` list. In the example above,
+users will need to authenticate to the OIDC provider to login to the Admin UI.
+
+== Editing Basic Authentication Plugin Configuration
+
+An Authentication API allows modifying user IDs and passwords.
+The API provides an endpoint with specific commands to set user details or delete a user.
+
+=== API Entry Point
+
+* v1: `\http://localhost:8983/solr/admin/authentication`
+* v2: `\http://localhost:8983/api/cluster/security/authentication`
+
+This endpoint is not collection-specific, so users are created for the entire Solr cluster.
+If users need to be restricted to a specific collection, that can be done with the authorization rules.
+
+=== Add a User or Edit a Password
+
+The `set-user` command allows you to add users and change their passwords.
+For example, the following defines two users and their passwords:
+
+[.dynamic-tabs]
+--
+[example.tab-pane#v1set-user]
+====
+[.tab-label]*V1 API*
+
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"set-user": {"tom":"TomIsCool", "harry":"HarrysSecret"}}'
+----
+====
+
+[example.tab-pane#v2set-user]
+====
+[.tab-label]*V2 API*
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"set-user": {"tom":"TomIsCool", "harry":"HarrysSecret"}}'
+----
+====
+--
+
+=== Delete a User
+
+The `delete-user` command allows you to remove a user.
+The user password does not need to be sent to remove a user.
+In the following example, we've asked that user IDs 'tom' and 'harry' be removed from the system.
+
+[.dynamic-tabs]
+--
+[example.tab-pane#v1delete-user]
+====
+[.tab-label]*V1 API*
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"delete-user": ["tom", "harry"]}'
+----
+====
+
+[example.tab-pane#v2delete-user]
+====
+[.tab-label]*V2 API*
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"delete-user": ["tom", "harry"]}'
+----
+====
+--
+
+=== Set a Property
+
+Set properties for the authentication plugin.
+The currently supported properties for the Basic Authentication plugin are `blockUnknown`, `realm`, and `forwardCredentials`.
+
+[.dynamic-tabs]
+--
+[example.tab-pane#v1set-property-blockUnknown]
+====
+[.tab-label]*V1 API*
+
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"set-property": {"blockUnknown":false}}'
+----
+====
+
+[example.tab-pane#v2set-property-blockUnknown]
+====
+[.tab-label]*V2 API*
+
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"set-property": {"blockUnknown":false}}'
+----
+====
+--
+
+The authentication realm defaults to `solr` and is displayed in the `WWW-Authenticate` HTTP header and in the Admin UI login page.
+To change the realm, set the `realm` property:
+
+[.dynamic-tabs]
+--
+[example.tab-pane#v1set-property-realm]
+====
+[.tab-label]*V1 API*
+
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"set-property": {"realm":"My Solr users"}}'
+----
+====
+
+[example.tab-pane#v2set-property-realm]
+====
+[.tab-label]*V2 API*
+
+[source,bash]
+----
+curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"set-property": {"realm":"My Solr users"}}'
+----
+====
+--
+
+=== Edit Plugin Configuration Using the MultiAuthPlugin
+
+When using the `MultiAuthPlugin`, you need to wrap the command data with a single-keyed object that identifies the `scheme`.
+For instance, the `set-user` command for the `Basic` plugin would be:
+
+[source,json]
+----
+{
+ "set-user": {
+ "basic": {"tom":"TomIsCool", "harry":"HarrysSecret"}
+ }
+}
+----
+
+Set a property on the `Basic` plugin when using the `MultiAuthPlugin`:
+[source,json]
+----
+{
+ "set-property": {
+ "basic": {"realm":"My Solr users"}
+ }
+}
+----
+
+== Using Basic Auth with SolrJ
+
+There are two main ways to use SolrJ with Solr servers protected by basic authentication: either the permissions can be set on each individual request, or the underlying http client can be configured to add credentials to all requests that it sends.
+
+=== Per-Request Basic Auth Credentials
+The simplest way to setup basic authentication in SolrJ is use the `setBasicAuthCredentials` method on each request as in this example:
+
+[source,java]
+----
+SolrRequest req ;//create a new request object
+req.setBasicAuthCredentials(userName, password);
+solrClient.request(req);
+----
+
+Query example:
+
+[source,java]
+----
+QueryRequest req = new QueryRequest(new SolrQuery("*:*"));
+req.setBasicAuthCredentials(userName, password);
+QueryResponse rsp = req.process(solrClient);
+----
+
+While this is method is simple, it can often be inconvenient to ensure the credentials are provided everywhere they're needed.
+It also doesn't work with the many `SolrClient` methods which don't consume `SolrRequest` objects.
+
+=== Per-Client Credentials
+Http2SolrClient supports setting the credentials at the client level when building it.
+This will ensure all requests issued with this particular client get the Basic Authentication headers set.
+
+[source,java]
+----
+Http2SolrClient client = new Http2SolrClient.Builder(solrUrl)
+ .withBasicAuthCredentials(userName, password).build();
+QueryResponse rsp = req.process(client);
+----
+
+CloudHttp2SolrClient supports receiving an `Http2SolrClient.Builder` instance for creating its internal client, so to set the credentials at the client level you could use a code like:
+
+[source,java]
+----
+Http2SolrClient.Builder http2ClientBuilder = Http2SolrClient.Builder().withBasicAuthCredentials(userName, password);
+CloudHttp2SolrClient client = new CloudHttp2SolrClient.Builder(zkHostList, chroot)
+ .withInternalClientBuilder(http2ClientBuilder).build();
+QueryResponse rsp = req.process(client);
+----
+
+=== Global (JVM) Basic Auth Credentials
+
+Alternatively, users can use SolrJ's `PreemptiveBasicAuthClientBuilderFactory` to add basic authentication credentials to _all_ requests automatically.
+To enable this feature, users should set the following system property `-Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory`.
+`PreemptiveBasicAuthClientBuilderFactory` allows applications to provide credentials in two different ways:
+
+. The `basicauth` system property can be passed, containing the credentials directly (e.g., `-Dbasicauth=username:password`).
+This option is straightforward, but may expose the credentials in the command line, depending on how they're set.
+. The `solr.httpclient.config` system property can be passed, containing a path to a properties file holding the credentials.
+Inside this file the username and password can be specified as `httpBasicAuthUser` and `httpBasicAuthPassword`, respectively.
++
+[source,bash]
+----
+httpBasicAuthUser=my_username
+httpBasicAuthPassword=secretPassword
+----
+
+== Using the Solr Control Script with Basic Auth
+
+Once Basic authentication is enabled, all requests to the Solr Control Script (`bin/solr`) must contain user credentials.
+To ensure this, add the following line to the `solr.in.sh` or `solr.in.cmd` file.
+
+This example tells the `bin/solr` command line to to use "basic" as the type of authentication, and to pass credentials with the user-name "solr" and password "SolrRocks":
+
+[source,bash]
+----
+SOLR_AUTH_TYPE="basic"
+SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"
+----
+
+Alternatively, the `SOLR_AUTHENTICATION_OPTS` can take a path to a file, as in:
+
- [source,bash]
++[source,bash,subs="attributes"]
++----
+SOLR_AUTH_TYPE="basic"
- SOLR_AUTHENTICATION_OPTS="-Dsolr.httpclient.config=/path/to/solr-{solr-docs-version}.0/server/solr/basicAuth.conf"
++SOLR_AUTHENTICATION_OPTS="-Dsolr.httpclient.config=/path/to/solr-{solr-full-version}/server/solr/basicAuth.conf"
++----
diff --cc solr/solr-ref-guide/modules/deployment-guide/pages/installing-solr.adoc
index 66c6b4b,0000000..26e7a29
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/installing-solr.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/installing-solr.adoc
@@@ -1,227 -1,0 +1,227 @@@
+= Installing Solr
+:toclevels: 1
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+Installation of Solr on Unix-compatible or Windows servers generally requires simply extracting (or, unzipping) the download package.
+
+Please be sure to review the xref:system-requirements.adoc[] before starting Solr.
+
+== Available Solr Packages
+
+Solr is available from the Solr website.
+Download the latest release https://solr.apache.org/downloads.html.
+
+There are two separate packages:
+
+* `solr-{solr-full-version}.tgz` the binary package, for all operating systems.
+* `solr-{solr-full-version}-src.tgz` the package Solr source code.
+This is useful if you want to develop on Solr without using the official Git repository.
+
+== Preparing for Installation
+
+When getting started with Solr, all you need to do is extract the Solr distribution archive to a directory of your choosing.
+This will suffice as an initial development environment, but take care not to overtax this "toy" installation before setting up your true development and production environments.
+
+When you've progressed past initial evaluation of Solr, you'll want to take care to plan your implementation.
+You may need to reinstall Solr on another server or make a clustered SolrCloud environment.
+
+When you're ready to setup Solr for a production environment, please refer to the instructions provided on the xref:taking-solr-to-production.adoc[] page.
+
+.What Size Server Do I Need?
+[NOTE]
+====
+How to size your Solr installation is a complex question that relies on a number of factors, including the number and structure of documents, how many fields you intend to store, the number of users, etc.
+
+It's highly recommended that you spend a bit of time thinking about the factors that will impact hardware sizing for your Solr implementation.
+A very good blog post that discusses the issues to consider is https://lucidworks.com/2012/07/23/sizing-hardware-in-the-abstract-why-we-dont-have-a-definitive-answer/[Sizing Hardware in the Abstract: Why We Don't have a Definitive Answer].
+====
+
+One thing to note when planning your installation is that a hard limit exists in Lucene for the number of documents in a single index: approximately 2.14 billion documents (2,147,483,647 to be exact).
+In practice, it is highly unlikely that such a large number of documents would fit and perform well in a single index, and you will likely need to distribute your index across a cluster before you ever approach this number.
+If you know you will exceed this number of documents in total before you've even started indexing, it's best to plan your installation with xref:cluster-types.adoc#solrcloud-mode[SolrCloud] as part of your design from the start.
+
+== Package Installation
+
+To keep things simple for now, extract the Solr distribution archive to your local home directory:
+
+[source,bash,subs="attributes"]
+----
+cd ~/
- tar zxf solr-{solr-docs-version}.0.tgz
++tar zxf solr-{solr-full-version}.tgz
+----
+
+Once extracted, you are now ready to run Solr using the instructions provided in the <<Starting Solr>> section below.
+
+TIP: Windows includes the `tar` tool since Windows 10. Open a command line window and execute the above comamnd. There are also several 3rd party un-archiving tools that support `.tar` archives.
+
+== Directory Layout
+
+After installing Solr, you'll see the following directories and files within them:
+
+bin/::
+This directory includes several important scripts that will make using Solr easier.
+
+solr and solr.cmd::: This is xref:solr-control-script-reference.adoc[Solr's Control Script], also known as `bin/solr` (*nix) / `bin/solr.cmd` (Windows).
+This script is the preferred tool to start and stop Solr.
+You can also create collections or cores, configure authentication, and work with configuration files when running in SolrCloud mode.
+
+post::: The xref:indexing-guide:post-tool.adoc[], which provides a simple command line interface for POSTing content to Solr.
+
+solr.in.sh and solr.in.cmd:::
+These are property files for *nix and Windows systems, respectively.
+System-level properties for Java, Jetty, and Solr are configured here.
+Many of these settings can be overridden when using `bin/solr` / `bin/solr.cmd`, but this allows you to set all the properties in one place.
+
+install_solr_services.sh:::
+This script is used on *nix systems to install Solr as a service.
+It is described in more detail in the section xref:taking-solr-to-production.adoc[].
+
+modules/::
+Solr's `modules` directory includes 1st-party add-on plugins for specialized features of Solr.
+
+prometheus-exporter/::
+A standalone application, included under `bin/`, that montiors Solr instances and produces Prometheus metrics.
+See the section xref:deployment-guide:monitoring-with-prometheus-and-grafana.adoc[] for more information.
+
+docker/::
+This contains a Dockerfile to build a Docker image from the binary distribution, that is compatible with the official image.
+This directory also contains the scripts needed when using Solr inside the Docker image, under the `scripts/` directory.
+The `README.md` in this directory describes how custom Solr Docker images can be built using this binary distribution.
+Refer to the section xref:deployment-guide:solr-in-docker.adoc[] page for information on using a Solr Docker image.
+
+docs/::
+The `docs` directory includes a link to online Javadocs for Solr.
+
+example/::
+The `example` directory includes several types of examples that demonstrate various Solr capabilities.
+See the section <<Solr Examples>> below for more details on what is in this directory.
+
+licenses/::
+The `licenses` directory includes all of the licenses for 3rd party libraries used by Solr.
+
+server/::
+This directory is where the heart of the Solr application resides.
+A README in this directory provides a detailed overview, but here are some highlights:
+* Solr's Admin UI & JAR files (`server/solr-webapp`)
+* Jetty libraries (`server/lib`)
+* Log files (`server/logs`) and log configurations (`server/resources`).
+See the section xref:configuring-logging.adoc[] for more details on how to customize Solr's default logging.
+* Sample configsets (`server/solr/configsets`)
+
+== Solr Examples
+
+Solr includes a number of example documents and configurations to use when getting started.
+If you ran through the xref:getting-started:solr-tutorial.adoc[], you have already interacted with some of these files.
+
+Here are the examples included with Solr:
+
+exampledocs::
+This is a small set of simple CSV, XML, and JSON files that can be used with `bin/post` when first getting started with Solr.
+For more information about using `bin/post` with these files, see xref:indexing-guide:post-tool.adoc[].
+
+files::
+The `files` directory provides a basic search UI for documents such as Word or PDF that you may have stored locally.
+See the README there for details on how to use this example.
+
+films::
+The `films` directory includes a robust set of data about movies in three formats: CSV, XML, and JSON.
+See the README there for details on how to use this dataset.
+
+== Starting Solr
+
+Solr includes a command line interface tool called `bin/solr` (Linux/MacOS) or `bin\solr.cmd` (Windows).
+This tool allows you to start and stop Solr, create cores and collections, configure authentication, and check the status of your system.
+
+To use it to start Solr you can simply enter:
+
+[source,bash]
+----
+bin/solr start
+----
+
+If you are running Windows, you can start Solr by running `bin\solr.cmd` instead.
+
+[source,plain]
+----
+bin\solr.cmd start
+----
+
+This will start Solr in the background, listening on port 8983.
+
+When you start Solr in the background, the script will wait to make sure Solr starts correctly before returning to the command line prompt.
+
+TIP: All of the options for the Solr CLI are described in the section xref:solr-control-script-reference.adoc[].
+
+=== Start Solr with a Specific Bundled Example
+
+Solr also provides a number of useful examples to help you learn about key features.
+You can launch the examples using the `-e` flag.
+For instance, to launch the "techproducts" example, you would do:
+
+[source,bash]
+----
+bin/solr -e techproducts
+----
+
+Currently, the available examples you can run are: techproducts, schemaless, and cloud.
+See the section xref:solr-control-script-reference.adoc#running-with-example-configurations[Running with Example Configurations] for details on each example.
+
+.Getting Started with SolrCloud
+NOTE: Running the `cloud` example starts Solr in xref:cluster-types.adoc#solrcloud-mode[SolrCloud] mode.
+For more information on starting Solr in SolrCloud mode, see the section xref:getting-started:tutorial-solrcloud.adoc[].
+
+=== Check if Solr is Running
+
+If you're not sure if Solr is running locally, you can use the status command:
+
+[source,bash]
+----
+bin/solr status
+----
+
+This will search for running Solr instances on your computer and then gather basic information about them, such as the version and memory usage.
+
+That's it! Solr is running.
+If you need convincing, use a Web browser to see the Admin Console.
+
+`\http://localhost:8983/solr/`
+
+.The Solr Admin interface.
+image::installing-solr/SolrAdminDashboard.png[Solr's Admin UI,pdfwidth=75%]
+
+If Solr is not running, your browser will complain that it cannot connect to the server.
+Check your port number and try again.
+
+=== Create a Core
+
+If you did not start Solr with an example configuration, you would need to create a core in order to be able to index and search.
+You can do so by running:
+
+[source,bash]
+----
+bin/solr create -c <name>
+----
+
+This will create a core that uses a data-driven schema which tries to guess the correct field type when you add documents to the index.
+
+To see all available options for creating a new core, execute:
+
+[source,bash]
+----
+bin/solr create -help
+----
diff --cc solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
index f58ce9a,0000000..d489d5a
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
@@@ -1,1479 -1,0 +1,1479 @@@
+= Solr Control Script Reference
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+Solr includes a script known as "`bin/solr`" that allows you to perform many common operations on your Solr installation or cluster.
+
+You can start and stop Solr, create and delete collections or cores, perform operations on ZooKeeper and check the status of Solr and configured shards.
+
+You can find the script in the `bin/` directory of your Solr installation.
+The `bin/solr` script makes Solr easier to work with by providing simple commands and options to quickly accomplish common goals.
+
+More examples of `bin/solr` in use are available throughout this Guide, but particularly in the sections xref:installing-solr.adoc#starting-solr[Starting Solr] and xref:getting-started:tutorial-solrcloud.adoc[].
+
+== Starting and Stopping
+
+=== Start and Restart
+
+The `start` command starts Solr.
+The `restart` command allows you to restart Solr while it is already running or if it has been stopped already.
+
+The `start` and `restart` commands have several options to allow you to run in SolrCloud mode, use an example configuration set, start with a hostname or port that is not the default and point to a local ZooKeeper ensemble.
+
+`bin/solr start [options]`
+
+`bin/solr start -help`
+
+`bin/solr restart [options]`
+
+`bin/solr restart -help`
+
+When using the `restart` command, you must pass all of the parameters you initially passed when you started Solr.
+Behind the scenes, a stop request is initiated, so Solr will be stopped before being started again.
+If no nodes are already running, restart will skip the step to stop and proceed to starting Solr.
+
+==== Start Parameters
+
+The `bin/solr` script provides many options to allow you to customize the server in common ways, such as changing the listening port.
+However, most of the defaults are adequate for most Solr installations, especially when just getting started.
+
+`-a "<string>"`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with additional JVM parameters, such as those starting with `-X`.
+If you are passing JVM parameters that begin with `-D`, you can omit the `-a` option.
++
+*Example*:
++
+[source,bash]
+bin/solr start -a "-Xdebug -Xrunjdwp:transport=dt_socket, server=y,suspend=n,address=1044"
+
+`-cloud` or `-c`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr in SolrCloud mode, which will also launch the embedded ZooKeeper instance included with Solr.
++
+This option can be shortened to simply `-c`.
++
+If you are already running a ZooKeeper ensemble that you want to use instead of the embedded (single-node) ZooKeeper, you should also either specify `ZK_HOST` in `solr.in.sh`/`solr.in.cmd` (see xref:zookeeper-ensemble.adoc#updating-solr-include-files[Updating Solr Include Files]) or pass the `-z` parameter.
++
+For more details, see the section <<SolrCloud Mode>> below.
++
+*Example*: `bin/solr start -c`
+
+`-d <dir>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `server/`
+|===
++
+Define a server directory, defaults to `server` (as in, `$SOLR_TIP/server`).
+It is uncommon to override this option.
+When running multiple instances of Solr on the same host, it is more common to use the same server directory for each instance and use a unique Solr home directory using the `-s` option.
++
+*Example*: `bin/solr start -d newServerDir`
+
+`-e <name>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with an example configuration.
+These examples are provided to help you get started faster with Solr generally, or just try a specific feature.
++
+The available options are:
+
+* `cloud`
+* `techproducts`
+* `schemaless`
+* `films`
++
+See the section <<Running with Example Configurations>> below for more details on the example configurations.
++
+*Example*: `bin/solr start -e schemaless`
+
+`-f`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr in the foreground.
+You cannot use this option when running examples with the `-e` option.
++
+*Example*: `bin/solr start -f`
+
+`-h <hostname>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `localhost`
+|===
++
+Start Solr with the defined hostname.
+If this is not specified, `localhost` is assumed.
++
+*Example*: `bin/solr start -h search.mysolr.com`
+
+`-m <memory>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with the defined value as the min (`-Xms`) and max (`-Xmx`) heap size for the JVM.
++
+*Example*: `bin/solr start -m 1g`
+
+`-noprompt`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr and suppress any prompts that may be seen with another option.
+This would have the side effect of accepting all defaults implicitly.
++
+For example, when using the "cloud" example, an interactive session guides you through several options for your SolrCloud cluster.
+If you want to accept all of the defaults, you can simply add the `-noprompt` option to your request.
++
+*Example*: `bin/solr start -e cloud -noprompt`
+
+`-p <port>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `8983`
+|===
++
+Start Solr on the defined port.
+If this is not specified, `8983` will be used.
++
+*Example*: `bin/solr start -p 8655`
+
+`-s <dir>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `server/solr`
+|===
++
+Sets the `solr.solr.home` system property.
+Solr will create core directories under this directory.
+This allows you to run multiple Solr instances on the same host while reusing the same server directory set using the `-d` parameter.
++
+This parameter is ignored when running examples (`-e`), as the `solr.solr.home` depends on which example is run.
++
+*Example*: `bin/solr start -s newHome`
+
+`-v`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Be more verbose.
+This changes the logging level of Log4j from `INFO` to `DEBUG`, having the same effect as if you edited `log4j2.xml`.
++
+*Example*: `bin/solr start -f -v`
+
+`-q`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Be more quiet.
+This changes the logging level of Log4j from `INFO` to `WARN`, having the same effect as if you edited `log4j2.xml`.
+This can be useful in a production setting where you want to limit logging to warnings and errors.
++
+*Example*: `bin/solr start -f -q`
+
+`-V`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Start Solr with verbose messages from the start script.
++
+*Example*: `bin/solr start -V`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: _see description_
+|===
++
+Start Solr with the defined ZooKeeper connection string.
++
+This option is only used with the `-c` option, to start Solr in SolrCloud mode.
+If `ZK_HOST` is not specified in `solr.in.sh`/`solr.in.cmd` and this option is not provided, Solr will start the embedded ZooKeeper instance and use that instance for SolrCloud operations.
++
+*Example*: `bin/solr start -c -z server1:2181,server2:2181`
+
+`-force`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+If attempting to start Solr as the root user, the script will exit with a warning that running Solr as "root" can cause problems.
+It is possible to override this warning with the `-force` parameter.
++
+*Example*: `sudo bin/solr start -force`
+
+To emphasize how the default settings work take a moment to understand that the following commands are equivalent:
+
+`bin/solr start`
+
+`bin/solr start -h localhost -p 8983 -d server -s solr -m 512m`
+
+It is not necessary to define all of the options when starting if the defaults are fine for your needs.
+
+==== Setting Java System Properties
+
+The `bin/solr` script will pass any additional parameters that begin with `-D` to the JVM, which allows you to set arbitrary Java system properties.
+
+For example, to set the auto soft-commit frequency to 3 seconds, you can do:
+
+`bin/solr start -Dsolr.autoSoftCommit.maxTime=3000`
+
+==== SolrCloud Mode
+
+The `-c` and `-cloud` options are equivalent:
+
+`bin/solr start -c`
+
+`bin/solr start -cloud`
+
+If you specify a ZooKeeper connection string, such as `-z 192.168.1.4:2181`, then Solr will connect to ZooKeeper and join the cluster.
+
+NOTE: If you have defined `ZK_HOST` in `solr.in.sh`/`solr.in.cmd` (see xref:zookeeper-ensemble.adoc#updating-solr-include-files,Updating Solr Include Files>>) you can omit `-z <zk host string>` from all `bin/solr` commands.
+
+When starting Solr in SolrCloud mode, if you do not define `ZK_HOST` in `solr.in.sh`/`solr.in.cmd` nor specify the `-z` option, then Solr will launch an embedded ZooKeeper server listening on the Solr port + 1000.
+For example, if Solr is running on port 8983, then the embedded ZooKeeper will listen on port 9983.
+
+[IMPORTANT]
+====
+If your ZooKeeper connection string uses a chroot, such as `localhost:2181/solr`, then you need to create the /solr znode before launching SolrCloud using the `bin/solr` script.
++
+To do this use the `mkroot` command outlined below, for example: `bin/solr zk mkroot /solr -z 192.168.1.4:2181`
+====
+
+When starting in SolrCloud mode, the interactive script session will prompt you to choose a configset to use.
+
+For more information about starting Solr in SolrCloud mode, see also the section xref:getting-started:tutorial-solrcloud.adoc[].
+
+==== Running with Example Configurations
+
+`bin/solr start -e <name>`
+
+The example configurations allow you to get started quickly with a configuration that mirrors what you hope to accomplish with Solr.
+
+Each example launches Solr with a managed schema, which allows use of the xref:indexing-guide:schema-api.adoc[] to make schema edits, but does not allow manual editing of a Schema file.
+
+If you would prefer to manually modify a `schema.xml` file directly, you can change this default as described in the section xref:configuration-guide:schema-factory.adoc[].
+
+Unless otherwise noted in the descriptions below, the examples do not enable SolrCloud nor xref:indexing-guide:schemaless-mode.adoc[].
+
+The following examples are provided:
+
+* *cloud*: This example starts a 1-4 node SolrCloud cluster on a single machine.
+When chosen, an interactive session will start to guide you through options to select the initial configset to use, the number of nodes for your example cluster, the ports to use, and name of the collection to be created.
++
+When using this example, you can choose from any of the available configsets found in `$SOLR_TIP/server/solr/configsets`.
+
+* *techproducts*: This example starts a single-node Solr instance with a schema designed for the sample documents included in the `$SOLR_HOME/example/exampledocs` directory.
++
+The configset used can be found in `$SOLR_TIP/server/solr/configsets/sample_techproducts_configs`.
++
+The data used can be found in `$SOLR_HOME/example/exampledocs/`.
+
+* *schemaless*: This example starts a single-node Solr instance using a managed schema, as described in the section xref:configuration-guide:schema-factory.adoc[], and provides a very minimal pre-defined schema.
+Solr will run in xref:indexing-guide:schemaless-mode.adoc[] with this configuration, where Solr will create fields in the schema on the fly and will guess field types used in incoming documents.
++
+The configset used can be found in `$SOLR_TIP/server/solr/configsets/_default`.
+
+* *films*: This example starts a single-node Solr instance using a managed schema, as described in the section xref:configuration-guide:schema-factory.adoc[], and then uses the Schema API to create some custom fields.
+Solr will run in xref:indexing-guide:schemaless-mode.adoc[] with this configuration, where Solr will create fields in the schema on the fly and will guess field types used in incoming documents as well.
+It then loads some sample film data.
++
+The configset used can be found in `$SOLR_TIP/server/solr/configsets/_default`.
++
+The film data used can be found in `$SOLR_HOME/example/films/films.json`.
+
+[IMPORTANT]
+====
+The run in-foreground option (`-f`) is not compatible with the `-e` option since the script needs to perform additional tasks after starting the Solr server.
+====
+
+=== Stop
+
+The `stop` command sends a STOP request to a running Solr node, which allows it to shutdown gracefully.
+The command will wait up to 180 seconds for Solr to stop gracefully and then will forcefully kill the process (`kill -9`).
+
+`bin/solr stop [options]`
+
+`bin/solr stop -help`
+
+==== Stop Parameters
+
+`-p <port>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Stop Solr running on the given port.
+If you are running more than one instance, or are running in SolrCloud mode, you either need to specify the ports in separate requests or use the `-all` option.
++
+*Example*: `bin/solr stop -p 8983`
+
+`-all`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Stop all running Solr instances that have a valid PID.
++
+*Example*: `bin/solr stop -all`
+
+`-k <key>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Stop key used to protect from stopping Solr inadvertently; default is "solrrocks".
++
+*Example*: `bin/solr stop -k solrrocks`
+
+
+== System Information
+
+=== Version
+
+The `version` command simply returns the version of Solr currently installed and immediately exists.
+
+[source,bash]
+----
+$ bin/solr version
+X.Y.0
+----
+
+=== Status
+
+The `status` command displays basic JSON-formatted information for any Solr nodes found running on the local system.
+
+The `status` command uses the `SOLR_PID_DIR` environment variable to locate Solr process ID files to find running Solr instances, which defaults to the `bin` directory.
+
+`bin/solr status`
+
+The output will include a status of each node of the cluster, as in this example:
+
+[source,plain]
+----
+Found 2 Solr nodes:
+
+Solr process 39920 running on port 7574
+{
+ "solr_home":"/Applications/Solr/example/cloud/node2/solr/",
+ "version":"X.Y.0",
+ "startTime":"2015-02-10T17:19:54.739Z",
+ "uptime":"1 days, 23 hours, 55 minutes, 48 seconds",
+ "memory":"77.2 MB (%15.7) of 490.7 MB",
+ "cloud":{
+ "ZooKeeper":"localhost:9865",
+ "liveNodes":"2",
+ "collections":"2"}}
+
+Solr process 39827 running on port 8865
+{
+ "solr_home":"/Applications/Solr/example/cloud/node1/solr/",
+ "version":"X.Y.0",
+ "startTime":"2015-02-10T17:19:49.057Z",
+ "uptime":"1 days, 23 hours, 55 minutes, 54 seconds",
+ "memory":"94.2 MB (%19.2) of 490.7 MB",
+ "cloud":{
+ "ZooKeeper":"localhost:9865",
+ "liveNodes":"2",
+ "collections":"2"}}
+----
+
+=== Assert
+
+The `assert` command sanity checks common issues with Solr installations.
+These include checking the ownership/existence of particular directories, and ensuring Solr is available on the expected URL.
+The command can either output a specified error message, or change its exit code to indicate errors.
+
+As an example:
+
+[source,bash]
+$ bin/solr assert --exists /opt/bin/solr
+
+Results in the output below:
+
+[source,plain]
+ERROR: Directory /opt/bin/solr does not exist.
+
+Use `bin/solr assert -help` for a full list of options.
+
+=== Healthcheck
+
+The `healthcheck` command generates a JSON-formatted health report for a collection when running in SolrCloud mode.
+The health report provides information about the state of every replica for all shards in a collection, including the number of committed documents and its current state.
+
+`bin/solr healthcheck [options]`
+
+`bin/solr healthcheck -help`
+
+==== Healthcheck Parameters
+
+`-c <collection>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+ Name of the collection to run a healthcheck against.
++
+*Example*: `bin/solr healthcheck -c gettingstarted`
+
+`-z <zkhost>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `localhost:9983`
+|===
++
+ZooKeeper connection string.
+If you are running Solr on a port other than 8983, you will have to specify the ZooKeeper connection string.
+By default, this will be the Solr port + 1000.
+This parameter is unnecessary if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `bin/solr healthcheck -z localhost:2181`
+
+Below is an example healthcheck request and response using a non-standard ZooKeeper connect string, with 2 nodes running:
+
+`$ bin/solr healthcheck -c gettingstarted -z localhost:9865`
+
+[source,json]
+----
+{
+ "collection":"gettingstarted",
+ "status":"healthy",
+ "numDocs":0,
+ "numShards":2,
+ "shards":[
+ {
+ "shard":"shard1",
+ "status":"healthy",
+ "replicas":[
+ {
+ "name":"core_node1",
+ "url":"http://10.0.1.10:8865/solr/gettingstarted_shard1_replica2/",
+ "numDocs":0,
+ "status":"active",
+ "uptime":"2 days, 1 hours, 18 minutes, 48 seconds",
+ "memory":"25.6 MB (%5.2) of 490.7 MB",
+ "leader":true},
+ {
+ "name":"core_node4",
+ "url":"http://10.0.1.10:7574/solr/gettingstarted_shard1_replica1/",
+ "numDocs":0,
+ "status":"active",
+ "uptime":"2 days, 1 hours, 18 minutes, 42 seconds",
+ "memory":"95.3 MB (%19.4) of 490.7 MB"}]},
+ {
+ "shard":"shard2",
+ "status":"healthy",
+ "replicas":[
+ {
+ "name":"core_node2",
+ "url":"http://10.0.1.10:8865/solr/gettingstarted_shard2_replica2/",
+ "numDocs":0,
+ "status":"active",
+ "uptime":"2 days, 1 hours, 18 minutes, 48 seconds",
+ "memory":"25.8 MB (%5.3) of 490.7 MB"},
+ {
+ "name":"core_node3",
+ "url":"http://10.0.1.10:7574/solr/gettingstarted_shard2_replica1/",
+ "numDocs":0,
+ "status":"active",
+ "uptime":"2 days, 1 hours, 18 minutes, 42 seconds",
+ "memory":"95.4 MB (%19.4) of 490.7 MB",
+ "leader":true}]}]}
+----
+
+== Collections and Cores
+
+The `bin/solr` script can also help you create new collections or cores, or delete collections or cores.
+
+=== Create a Core or Collection
+
+The `create` command detects the mode that Solr is running in and creates either a core or collection depending on the mode.
+When running with SolrCloud, a collection would be created.
+When running a user-managed cluster or a single-node installation, a core would be created.
+
+`bin/solr create [options]`
+
+`bin/solr create -help`
+
+==== Create Core or Collection Parameters
+
+`-c <name>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Name of the core or collection to create.
++
+*Example*: `bin/solr create -c mycollection`
+
+`-d <confdir>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `_default`
+|===
++
+The configuration directory.
++
+See the section <<Configuration Directories and SolrCloud>> below for more details about this option when running in SolrCloud mode.
++
+*Example*: `bin/solr create -d _default`
+
+`-n <configName>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: _see description_
+|===
++
+The configuration name.
+This defaults to the same name as the core or collection.
++
+*Example*: `bin/solr create -n basic`
+
+`-p <port>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: _see description_
+|===
++
+The port of a local Solr instance to send the create command to.
+By default the script tries to detect the port by looking for running Solr instances.
++
+This option is useful if you are running multiple Solr instances on the same host, thus requiring you to be specific about which instance to create the core in.
++
+*Example*: `bin/solr create -p 8983`
+
+`-s <shards>` or `-shards`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `1`
+|===
++
+Number of shards to split a collection into.
+Only applies when Solr is running in SolrCloud mode.
++
+*Example*: `bin/solr create -s 2`
+
+`-rf <replicas>` or `-replicationFactor`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `1`
+|===
++
+Number of copies of each document in the collection.
+The default is `1` (no replication).
++
+*Example*: `bin/solr create -rf 2`
+
+`-force`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+If attempting to run create as "root" user, the script will exit with a warning that running Solr or actions against Solr as "root" can cause problems.
+It is possible to override this warning with the -force parameter.
++
+*Example*: `bin/solr create -c foo -force`
+
+==== Configuration Directories and SolrCloud
+
+Before creating a collection in SolrCloud, the configuration directory used by the collection must be uploaded to ZooKeeper.
+The `create` command supports several use cases for how collections and configuration directories work.
+The main decision you need to make is whether a configuration directory in ZooKeeper should be shared across multiple collections.
+
+Let's work through a few examples to illustrate how configuration directories work in SolrCloud.
+
+First, if you don't provide the `-d` or `-n` options, then the default configuration (`$SOLR_TIP/server/solr/configsets/_default/conf`) is uploaded to ZooKeeper using the same name as the collection.
+
+For example, the following command will result in the `_default` configuration being uploaded to `/configs/contacts` in ZooKeeper: `bin/solr create -c contacts`.
+
+If you create another collection with `bin/solr create -c contacts2`, then another copy of the `_default` directory will be uploaded to ZooKeeper under `/configs/contacts2`.
+
+Any changes you make to the configuration for the contacts collection will not affect the `contacts2` collection.
+Put simply, the default behavior creates a unique copy of the configuration directory for each collection you create.
+
+You can override the name given to the configuration directory in ZooKeeper by using the `-n` option.
+For instance, the command `bin/solr create -c logs -d _default -n basic` will upload the `server/solr/configsets/_default/conf` directory to ZooKeeper as `/configs/basic`.
+
+Notice that we used the `-d` option to specify a different configuration than the default.
+Solr provides several built-in configurations under `server/solr/configsets`.
+However you can also provide the path to your own configuration directory using the `-d` option.
+For instance, the command `bin/solr create -c mycoll -d /tmp/myconfigs`, will upload `/tmp/myconfigs` into ZooKeeper under `/configs/mycoll`.
+
+To reiterate, the configuration directory is named after the collection unless you override it using the `-n` option.
+
+Other collections can share the same configuration by specifying the name of the shared configuration using the `-n` option.
+For instance, the following command will create a new collection that shares the basic configuration created previously: `bin/solr create -c logs2 -n basic`.
+
+==== Data-driven Schema and Shared Configurations
+
+The `_default` schema can mutate as data is indexed, since it has schemaless functionality (i.e., data-driven changes to the schema).
+Consequently, we recommend that you do not share data-driven configurations between collections unless you are certain that all collections should inherit the changes made when indexing data into one of the collections.
+
+You can turn off schemaless functionality for a collection with the following command, assuming the collection name is `mycollection`.
+
+[source,bash]
+$ bin/solr config -c mycollection -p 8983 -action set-user-property -property update.autoCreateFields -value false
+
+See also the section <<Set or Unset Configuration Properties>>.
+
+=== Delete Core or Collection
+
+The `delete` command detects the mode that Solr is running in and then deletes the specified core (user-managed or single-node) or collection (SolrCloud) as appropriate.
+
+`bin/solr delete [options]`
+
+`bin/solr delete -help`
+
+If running in SolrCloud mode, the `delete` command checks if the configuration directory used by the collection you are deleting is being used by other collections.
+If not, then the configuration directory is also deleted from ZooKeeper.
+
+For example, if you created a collection with `bin/solr create -c contacts`, then the delete command `bin/solr delete -c contacts` will check to see if the `/configs/contacts` configuration directory is being used by any other collections.
+If not, then the `/configs/contacts` directory is removed from ZooKeeper.
+
+==== Delete Core or Collection Parameters
+
+`-c <name>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Name of the core or collection to delete.
++
+*Example*: `bin/solr delete -c mycoll`
+
+`-deleteConfig`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `true`
+|===
++
+Whether or not the configuration directory should also be deleted from ZooKeeper.
++
+If the configuration directory is being used by another collection, then it will not be deleted even if you pass `-deleteConfig` as `true`.
++
+*Example*: `bin/solr delete -deleteConfig false`
+
+`-p <port>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: _see description_
+|===
++
+The port of a local Solr instance to send the delete command to.
+By default the script tries to detect the port by looking for running Solr instances.
++
+This option is useful if you are running multiple Solr instances on the same host, thus requiring you to be specific about which instance to delete the core from.
++
+*Example*: `bin/solr delete -p 8983`
+
+== Authentication
+
+The `bin/solr` script allows enabling or disabling Basic Authentication, allowing you to configure authentication from the command line.
+
+Currently, this script only enables Basic Authentication, and is only available when using SolrCloud mode.
+
+=== Enabling Basic Authentication
+
+The command `bin/solr auth enable` configures Solr to use Basic Authentication when accessing the User Interface, using `bin/solr` and any API requests.
+
+TIP: For more information about Solr's authentication plugins, see the section xref:securing-solr.adoc[].
+For more information on Basic Authentication support specifically, see the section xref:basic-authentication-plugin.adoc[].
+
+The `bin/solr auth enable` command makes several changes to enable Basic Authentication:
+
+* Creates a `security.json` file and uploads it to ZooKeeper.
+The `security.json` file will look similar to:
++
+[source,json]
+----
+{
+ "authentication":{
+ "blockUnknown": false,
+ "class":"solr.BasicAuthPlugin",
+ "credentials":{"user":"vgGVo69YJeUg/O6AcFiowWsdyOUdqfQvOLsrpIPMCzk= 7iTnaKOWe+Uj5ZfGoKKK2G6hrcF10h6xezMQK+LBvpI="}
+ },
+ "authorization":{
+ "class":"solr.RuleBasedAuthorizationPlugin",
+ "permissions":[
+ {"name":"security-edit", "role":"admin"},
+ {"name":"collection-admin-edit", "role":"admin"},
+ {"name":"core-admin-edit", "role":"admin"}
+ ],
+ "user-role":{"user":"admin"}
+ }
+}
+----
+* Adds two lines to `bin/solr.in.sh` or `bin\solr.in.cmd` to set the authentication type, and the path to `basicAuth.conf`:
++
+[source,subs="attributes"]
+----
+# The following lines added by ./solr for enabling BasicAuth
+SOLR_AUTH_TYPE="basic"
- SOLR_AUTHENTICATION_OPTS="-Dsolr.httpclient.config=/path/to/solr-{solr-docs-version}.0/server/solr/basicAuth.conf"
++SOLR_AUTHENTICATION_OPTS="-Dsolr.httpclient.config=/path/to/solr-{solr-full-version}/server/solr/basicAuth.conf"
+----
+* Creates the file `server/solr/basicAuth.conf` to store the credential information that is used with `bin/solr` commands.
+
+The command takes the following parameters:
+
+`-credentials`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+The username and password in the format of `username:password` of the initial user.
++
+If you prefer not to pass the username and password as an argument to the script, you can choose the `-prompt` option.
+Either `-credentials` or `-prompt` *must* be specified.
+
+`-prompt`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+If prompt is preferred, pass `true` as a parameter to request the script to prompt the user to enter a username and password.
++
+Either `-credentials` or `-prompt` *must* be specified.
+
+`-blockUnknown`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `true`
+|===
++
+When `true`, blocks all unauthenticated users from accessing Solr.
+When `false`, unauthenticated users will still be able to access Solr, but only for operations not explicitly requiring a user role in the Authorization plugin configuration.
+
+`-updateIncludeFileOnly`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `false`
+|===
++
+When `true`, only the settings in `bin/solr.in.sh` or `bin\solr.in.cmd` will be updated, and `security.json` will not be created.
+
+`-z`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Defines the ZooKeeper connect string.
+This is useful if you want to enable authentication before all your Solr nodes have come up.
+Unnecessary if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
+
+`-d`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `$SOLR_TIP/server`
+|===
++
+Defines the Solr server directory, by default `$SOLR_TIP/server`.
+It is not common to need to override the default, and is only needed if you have customized the `$SOLR_HOME` directory path.
+
+`-s`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `server/solr`
+|===
++
+Defines the location of `solr.solr.home`, which by default is `server/solr`.
+If you have multiple instances of Solr on the same host, or if you have customized the `$SOLR_HOME` directory path, you likely need to define this.
+
+=== Disabling Basic Authentication
+
+You can disable Basic Authentication with `bin/solr auth disable`.
+
+If the `-updateIncludeFileOnly` option is set to *true*, then only the settings in `bin/solr.in.sh` or `bin\solr.in.cmd` will be updated, and `security.json` will not be removed.
+
+If the `-updateIncludeFileOnly` option is set to *false*, then the settings in `bin/solr.in.sh` or `bin\solr.in.cmd` will be updated, and `security.json` will be removed.
+However, the `basicAuth.conf` file is not removed with either option.
+
+== Set or Unset Configuration Properties
+
+The `bin/solr` script enables a subset of the Config API: xref:configuration-guide:config-api.adoc#commands-for-common-properties[(un)setting common properties] and xref:configuration-guide:config-api.adoc#commands-for-user-defined-properties[(un)setting user-defined properties].
+
+`bin/solr config [options]`
+
+`bin/solr config -help`
+
+=== Set or Unset Common Properties
+
+To set the common property `updateHandler.autoCommit.maxDocs` to `100` on collection `mycollection`:
+
+`bin/solr config -c mycollection -p 8983 -action set-property -property updateHandler.autoCommit.maxDocs -value 100`
+
+The default `-action` is `set-property`, so the above can be shortened by not mentioning it:
+
+`bin/solr config -c mycollection -p 8983 -property updateHandler.autoCommit.maxDocs -value 100`
+
+To unset a previously set common property, specify `-action unset-property` with no `-value`:
+
+`bin/solr config -c mycollection -p 8983 -action unset-property -property updateHandler.autoCommit.maxDocs`
+
+=== Set or Unset User-Defined Properties
+
+To set the user-defined property `update.autoCreateFields` to `false` (to disable xref:indexing-guide:schemaless-mode.adoc[]):
+
+`bin/solr config -c mycollection -p 8983 -action set-user-property -property update.autoCreateFields -value false`
+
+To unset a previously set user-defined property, specify `-action unset-user-property` with no `-value`:
+
+`bin/solr config -c mycollection -p 8983 -action unset-user-property -property update.autoCreateFields`
+
+=== Config Parameters
+
+`-c <name>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Name of the core or collection on which to change configuration.
+
+`-action <name>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `set-property`
+|===
++
+Config API action, one of: `set-property`, `unset-property`, `set-user-property`, `unset-user-property`.
+
+`-property <name>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Name of the property to change.
+
+`-value <new-value>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Set the property to this value.
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+The ZooKeeper connection string, usable in SolrCloud mode.
+Unnecessary if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
+
+`-p <port>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+`localhost` port of the Solr node to use when applying the configuration change.
+
+`-solrUrl <url>`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Base Solr URL, which can be used in SolrCloud mode to determine the ZooKeeper connection string if that's not known.
+
+== ZooKeeper Operations
+
+The `bin/solr` script allows certain operations affecting ZooKeeper.
+These operations are for SolrCloud mode only.
+
+The operations are available as sub-commands, which each have their own set of options.
+
+`bin/solr zk [sub-command] [options]`
+
+`bin/solr zk -help`
+
+NOTE: Solr should have been started at least once before issuing these commands to initialize ZooKeeper with the znodes Solr expects.
+Once ZooKeeper is initialized, Solr doesn't need to be running on any node to use these commands.
+
+=== Upload a Configuration Set
+
+Use the `zk upconfig` command to upload one of the pre-configured configuration set or a customized configuration set to ZooKeeper.
+
+==== ZK Upload Parameters
+
+All parameters below are required.
+
+`-n <name>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Name of the configuration set in ZooKeeper.
+This command will upload the configuration set to the "configs" ZooKeeper node giving it the name specified.
++
+You can see all uploaded configuration sets in the Admin UI via the Cloud screens.
+Choose Cloud -> Tree -> configs to see them.
++
+If a pre-existing configuration set is specified, it will be overwritten in ZooKeeper.
++
+*Example*: `-n myconfig`
+
+`-d <configset dir>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The path of the configuration set to upload.
+It should have a `conf` directory immediately below it that in turn contains `solrconfig.xml` etc.
++
+If just a name is supplied, `$SOLR_TIP/server/solr/configsets` will be checked for this name.
+An absolute path may be supplied instead.
++
+*Examples*:
+
+* `-d directory_under_configsets`
+* `-d /path/to/configset/source`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The ZooKeeper connection string.
+Is not required if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `-z 123.321.23.43:2181`
+
+An example of this command with all of the parameters is:
+
+[source,bash]
+bin/solr zk upconfig -z 111.222.333.444:2181 -n mynewconfig -d /path/to/configset
+
+.Reload Collections When Changing Configurations
+[WARNING]
+====
+This command does *not* automatically make changes effective!
+It simply uploads the configuration sets to ZooKeeper.
+You can use the Collection API's xref:collection-management.adoc#reload[RELOAD command] to reload any collections that uses this configuration set.
+====
+
+=== Download a Configuration Set
+
+Use the `zk downconfig` command to download a configuration set from ZooKeeper to the local filesystem.
+
+==== ZK Download Parameters
+
+All parameters listed below are required.
+
+`-n <name>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Name of the configset in ZooKeeper to download.
+The Admin UI Cloud -> Tree -> configs node lists all available configuration sets.
++
+*Example*: `-n myconfig`
+
+`-d <configset dir>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The path to write the downloaded configuration set into.
+If just a name is supplied, `$SOLR_TIP/server/solr/configsets` will be the parent.
+An absolute path may be supplied as well.
++
+In either case, _pre-existing configurations at the destination will be overwritten_!
++
+*Examples*:
+
+* `-d directory_under_configsets`
+* `-d /path/to/configset/destination`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The ZooKeeper connection string.
+Unnecessary if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `-z 123.321.23.43:2181`
+
+An example of this command with all parameters is:
+
+[source,bash]
+bin/solr zk downconfig -z 111.222.333.444:2181 -n mynewconfig -d /path/to/configset
+
+A best practice is to keep your configuration sets in some form of version control as the system-of-record.
+In that scenario, `downconfig` should rarely be used.
+
+=== Copy between Local Files and ZooKeeper znodes
+
+Use the `zk cp` command for transferring files and directories between ZooKeeper znodes and your local drive.
+This command will copy from the local drive to ZooKeeper, from ZooKeeper to the local drive or from ZooKeeper to ZooKeeper.
+
+==== ZK Copy Parameters
+
+`-r`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Do a recursive copy.
+The command will fail if the `<src>` has children unless `-r` is specified.
++
+*Example*: `-r`
+
+`<src>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The file or path to copy from.
+If prefixed with `zk:` then the source is presumed to be ZooKeeper.
+If no prefix or the prefix is `file`: this is the local drive.
+At least one of `<src>` or `<dest>` must be prefixed by `'zk:'` or the command will fail.
++
+*Examples*:
+
+* `zk:/configs/myconfigs/solrconfig.xml`
+* `file:/Users/apache/configs/src`
+
+`<dest>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The file or path to copy to.
+If prefixed with `zk:` then the source is presumed to be ZooKeeper.
+If no prefix or the prefix is `file:` this is the local drive.
++
+At least one of `<src>` or `<dest>` must be prefixed by `zk:` or the command will fail.
+If `<dest>` ends in a slash character it names a directory.
++
+*Examples*:
+
+* `zk:/configs/myconfigs/solrconfig.xml`
+* `file:/Users/apache/configs/src`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The ZooKeeper connection string.
+Optional if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `-z 123.321.23.43:2181`
+
+An example of this command with the parameters is:
+
+Recursively copy a directory from local to ZooKeeper.
+
+`bin/solr zk cp -r file:/apache/confgs/whatever/conf zk:/configs/myconf -z 111.222.333.444:2181`
+
+Copy a single file from ZooKeeper to local.
+
+`bin/solr zk cp zk:/configs/myconf/managed_schema /configs/myconf/managed_schema -z 111.222.333.444:2181`
+
+=== Remove a znode from ZooKeeper
+
+Use the `zk rm` command to remove a znode (and optionally all child nodes) from ZooKeeper.
+
+==== ZK Remove Parameters
+
+`-r`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Do a recursive removal.
+The command will fail if the `<path>` has children unless `-r` is specified.
++
+*Example*: `-r`
+
+`<path>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The path to remove from ZooKeeper, either a parent or leaf node.
++
+There are limited safety checks, you cannot remove `/` or `/zookeeper` nodes.
++
+The path is assumed to be a ZooKeeper node, no `zk:` prefix is necessary.
++
+*Examples*:
+
+* `/configs`
+* `/configs/myconfigset`
+* `/configs/myconfigset/solrconfig.xml`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The ZooKeeper connection string.
+Optional if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `-z 123.321.23.43:2181`
+
+Examples of this command with the parameters are:
+
+`bin/solr zk rm -r /configs`
+
+`bin/solr zk rm /configs/myconfigset/schema.xml`
+
+
+=== Move One ZooKeeper znode to Another (Rename)
+
+Use the `zk mv` command to move (rename) a ZooKeeper znode.
+
+==== ZK Move Parameters
+
+`<src>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The znode to rename.
+The `zk:` prefix is assumed.
++
+*Example*: `/configs/oldconfigset`
+
+`<dest>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The new name of the znode.
+The `zk:` prefix is assumed.
++
+*Example*: `/configs/newconfigset`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The ZooKeeper connection string.
+Unnecessary if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `-z 123.321.23.43:2181`
+
+An example of this command is:
+
+`bin/solr zk mv /configs/oldconfigset /configs/newconfigset`
+
+
+=== List a ZooKeeper znode's Children
+
+Use the `zk ls` command to see the children of a znode.
+
+==== ZK List Parameters
+
+`-r`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+Recursively list all descendants of a znode.
++
+*Example*: `-r`
+
+`<path>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The path on ZooKeeper to list.
++
+*Example*: `/collections/mycollection`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The ZooKeeper connection string.
+Optional if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `-z 123.321.23.43:2181`
+
+An example of this command with the parameters is:
+
+`bin/solr zk ls -r /collections/mycollection`
+
+`bin/solr zk ls /collections`
+
+
+=== Create a znode (supports chroot)
+
+Use the `zk mkroot` command to create a znode.
+The primary use-case for this command to support ZooKeeper's "chroot" concept.
+However, it can also be used to create arbitrary paths.
+
+==== Create znode Parameters
+
+`<path>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The path on ZooKeeper to create.
+Intermediate znodes will be created if necessary.
+A leading slash is assumed even if not specified.
++
+*Example*: `/solr`
+
+`-z <zkHost>`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+The ZooKeeper connection string.
+Optional if `ZK_HOST` is defined in `solr.in.sh` or `solr.in.cmd`.
++
+*Example*: `-z 123.321.23.43:2181`
+
+Examples of this command:
+
+`bin/solr zk mkroot /solr -z 123.321.23.43:2181`
+
+`bin/solr zk mkroot /solr/production`
+
+== Exporting Documents to a File
+
+The `export` command will allow you to export documents from a collection in either JSON or Javabin format.
+All documents can be exported, or only those that match a query.
+
+`bin/solr export [options]`
+
+`bin/solr export -help`
+
+The `bin/solr export` command takes the following parameters:
+
+`url`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Fully-qualified address to a collection.
++
+*Example*: `-url http://localhost:8983/solr/techproducts`
+
+`format`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `jsonl`
+|===
++
+The file format of the export, `jsonl` or `javabin`.
+Choosing `javabin` exports to a file with extension `.javabin` which is the native Solr format.
+This is compact and faster to import.
+
+`-out`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: _see description_
+|===
++
+The file name of the export.
+If the file name ends with `json.gz` the output will be compressed into a .gz file.
++
+If not provided, a file will be created with the name of the collection, as in `<collection>.json`.
+
+`query`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `\*:*`
+|===
++
+A custom query.
+The default is `\*:*` which will export all documents.
+
+`fields`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+A comma separated list of fields to be exported.
+If not provided, all fields will be included.
+
+`limit`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `100`
+|===
++
+The number of documents to export.
+The value `-1` will export all documents.
+
+*Examples*
+
+Export all documents from a collection `gettingstarted`:
+
+[source,bash]
+bin/solr export -url http://localhost:8983/solr/gettingstarted limit -1
+
+Export all documents of collection `gettingstarted` into a file called `1MDocs.json.gz` as a zipped JSON file:
+
+[source,bash]
+----
+bin/solr export -url http://localhost:8983/solr/gettingstarted -1 -out 1MDocs.json.gz
+----
+
+=== Importing Documents to a Collection
+
+Once you have exported documents in a file, you can use the xref:indexing-guide:indexing-with-update-handlers.adoc[/update request handler] to import them to a new Solr collection.
+
+*Example: import `jsonl` files*
+
+`curl -X POST -d @gettingstarted.json http://localhost:8983/solr/gettingstarted/update/json/docs?commit=true`
+
+*Example: import `javabin` files*
+
+`curl -X POST --header "Content-Type: application/javabin" --data-binary @gettingstarted.javabin http://localhost:8983/solr/gettingstarted/update?commit=true`
diff --cc solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc
index 04fb63b,0000000..fe09c59
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/taking-solr-to-production.adoc
@@@ -1,477 -1,0 +1,477 @@@
+= Taking Solr to Production
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+This section provides guidance on how to setup Solr to run in production on *nix platforms, such as Ubuntu.
+Specifically, we’ll walk through the process of setting up to run a single Solr instance on a Linux host and then provide tips on how to support multiple Solr nodes running on the same host.
+
+== Service Installation Script
+
+Solr includes a service installation script (`bin/install_solr_service.sh`) to help you install Solr as a service on Linux.
+Currently, the script only supports CentOS, Debian, Red Hat, SUSE and Ubuntu Linux distributions.
+Before running the script, you need to determine a few parameters about your setup.
+Specifically, you need to decide where to install Solr and which system user should be the owner of the Solr files and process.
+
+=== Planning Your Directory Structure
+
+We recommend separating your live Solr files, such as logs and index files, from the files included in the Solr distribution bundle, as that makes it easier to upgrade Solr and is considered a good practice to follow as a system administrator.
+
+==== Solr Installation Directory
+
+By default, the service installation script will extract the distribution archive into `/opt`.
+You can change this location using the `-i` option when running the installation script.
+The script will also create a symbolic link to the versioned directory of Solr.
- For instance, if you run the installation script for Solr {solr-docs-version}.0, then the following directory structure will be used:
++For instance, if you run the installation script for Solr {solr-full-version}, then the following directory structure will be used:
+
+[source,plain,subs="attributes"]
+----
- /opt/solr-{solr-docs-version}.0
- /opt/solr -> /opt/solr-{solr-docs-version}.0
++/opt/solr-{solr-full-version}
++/opt/solr -> /opt/solr-{solr-full-version}
+----
+
+Using a symbolic link insulates any scripts from being dependent on the specific Solr version.
+If, down the road, you need to upgrade to a later version of Solr, you can just update the symbolic link to point to the upgraded version of Solr.
+We’ll use `/opt/solr` to refer to the Solr installation directory in the remaining sections of this page.
+
+==== Separate Directory for Writable Files
+
+You should also separate writable Solr files into a different directory; by default, the installation script uses `/var/solr`, but you can override this location using the `-d` option.
+With this approach, the files in `/opt/solr` will remain untouched and all files that change while Solr is running will live under `/var/solr`.
+
+=== Create the Solr User
+
+Running Solr as `root` is not recommended for security reasons, and the xref:solr-control-script-reference.adoc#starting-and-stopping[`bin/solr start`] command will refuse to do so.
+Consequently, you should determine the username of a system user that will own all of the Solr files and the running Solr process.
+By default, the installation script will create the *solr* user, but you can override this setting using the -u option.
+If your organization has specific requirements for creating new user accounts, then you should create the user before running the script.
+The installation script will make the Solr user the owner of the `/opt/solr` and `/var/solr` directories.
+
+You are now ready to run the installation script.
+
+=== Run the Solr Installation Script
+
+To run the script, you'll need to download the latest Solr distribution archive and then do the following:
+
+[source,bash,subs="attributes"]
+----
- tar xzf solr-{solr-docs-version}.0.tgz solr-{solr-docs-version}.0/bin/install_solr_service.sh --strip-components=2
++tar xzf solr-{solr-full-version}.tgz solr-{solr-full-version}/bin/install_solr_service.sh --strip-components=2
+----
+
+The previous command extracts the `install_solr_service.sh` script from the archive into the current directory.
+If installing on Red Hat, please make sure *lsof* is installed before running the Solr installation script (`sudo yum install lsof`).
+The installation script must be run as root:
+
+[source,bash,subs="attributes"]
+----
- sudo bash ./install_solr_service.sh solr-{solr-docs-version}.0.tgz
++sudo bash ./install_solr_service.sh solr-{solr-full-version}.tgz
+----
+
+By default, the script extracts the distribution archive into `/opt`, configures Solr to write files into `/var/solr`, and runs Solr as the `solr` user.
+Consequently, the following command produces the same result as the previous command:
+
+[source,bash,subs="attributes"]
+----
- sudo bash ./install_solr_service.sh solr-{solr-docs-version}.0.tgz -i /opt -d /var/solr -u solr -s solr -p 8983
++sudo bash ./install_solr_service.sh solr-{solr-full-version}.tgz -i /opt -d /var/solr -u solr -s solr -p 8983
+----
+
+You can customize the service name, installation directories, port, and owner using options passed to the installation script.
+To see available options, simply do:
+
+[source,bash]
+----
+sudo bash ./install_solr_service.sh -help
+----
+
+Once the script completes, Solr will be installed as a service and running in the background on your server (on port 8983).
+To verify, you can do:
+
+[source,bash]
+----
+sudo service solr status
+----
+
+If you do not want to start the service immediately, pass the `-n` option.
+You can then start the service manually later, e.g., after completing the configuration setup.
+
+We'll cover some additional configuration settings you can make to fine-tune your Solr setup in a moment.
+Before moving on, let's take a closer look at the steps performed by the installation script.
+This gives you a better overview and will help you understand important details about your Solr installation when reading other pages in this guide; such as when a page refers to Solr home, you'll know exactly where that is on your system.
+
+==== Solr Home Directory
+
+The Solr home directory (not to be confused with the Solr installation directory) is where Solr manages core directories with index files.
+By default, the installation script uses `/var/solr/data`.
+If the `-d` option is used on the install script, then this will change to the `data` subdirectory in the location given to the -d option.
+Take a moment to inspect the contents of the Solr home directory on your system.
+If you do not xref:zookeeper-file-management.adoc[store `solr.xml` in ZooKeeper], the home directory must contain a `solr.xml` file.
+When Solr starts up, the Solr Control Script passes the location of the home directory using the `-Dsolr.solr.home=...` system property.
+
+==== Environment Overrides Include File
+
+The service installation script creates an environment specific include file that overrides defaults used by the `bin/solr` script.
+The main advantage of using an include file is that it provides a single location where all of your environment-specific overrides are defined.
+Take a moment to inspect the contents of the `/etc/default/solr.in.sh` file, which is the default path setup by the installation script.
+If you used the `-s` option on the install script to change the name of the service, then the first part of the filename will be different.
+For a service named `solr-demo`, the file will be named `/etc/default/solr-demo.in.sh`.
+There are many settings that you can override using this file.
+However, at a minimum, this script needs to define the `SOLR_PID_DIR` and `SOLR_HOME` variables, such as:
+
+[source,bash]
+----
+SOLR_PID_DIR=/var/solr
+SOLR_HOME=/var/solr/data
+----
+
+The `SOLR_PID_DIR` variable sets the directory where the xref:solr-control-script-reference.adoc[control script] will write out a file containing the Solr server’s process ID.
+
+==== Log Settings
+
+Solr uses Apache Log4J for logging.
+The installation script copies `/opt/solr/server/resources/log4j2.xml` to `/var/solr/log4j2.xml`.
+Take a moment to verify that the Solr include file is configured to send logs to the correct location by checking the following settings in `/etc/default/solr.in.sh`:
+
+[source,bash]
+----
+LOG4J_PROPS=/var/solr/log4j2.xml
+SOLR_LOGS_DIR=/var/solr/logs
+----
+
+For more information about Log4J configuration, please see: xref:configuring-logging.adoc[].
+
+==== init.d Script
+
+When running a service like Solr on Linux, it’s common to setup an init.d script so that system administrators can control Solr using the service tool, such as: `service solr start`.
+The installation script creates a very basic init.d script to help you get started.
+Take a moment to inspect the `/etc/init.d/solr` file, which is the default script name setup by the installation script.
+If you used the `-s` option on the install script to change the name of the service, then the filename will be different.
+Notice that the following variables are setup for your environment based on the parameters passed to the installation script:
+
+[source,bash]
+----
+SOLR_INSTALL_DIR=/opt/solr
+SOLR_ENV=/etc/default/solr.in.sh
+RUNAS=solr
+----
+
+The `SOLR_INSTALL_DIR` and `SOLR_ENV` variables should be self-explanatory.
+The `RUNAS` variable sets the owner of the Solr process, such as `solr`; if you don’t set this value, the script will run Solr as **root**, which is not recommended for production.
+You can use the `/etc/init.d/solr` script to start Solr by doing the following as root:
+
+[source,bash]
+----
+service solr start
+----
+
+The `/etc/init.d/solr` script also supports the **stop**, **restart**, and *status* commands.
+Please keep in mind that the init script that ships with Solr is very basic and is intended to show you how to setup Solr as a service.
+However, it’s also common to use more advanced tools like *supervisord* or *upstart* to control Solr as a service on Linux.
+While showing how to integrate Solr with tools like supervisord is beyond the scope of this guide, the `init.d/solr` script should provide enough guidance to help you get started.
+Also, the installation script sets the Solr service to start automatically when the host machine initializes.
+
+=== Progress Check
+
+In the next section, we cover some additional environment settings to help you fine-tune your production setup.
+However, before we move on, let's review what we've achieved thus far.
+Specifically, you should be able to control Solr using `/etc/init.d/solr`.
+Please verify the following commands work with your setup:
+
+[source,bash]
+----
+sudo service solr restart
+sudo service solr status
+----
+
+The status command should give some basic information about the running Solr node that looks similar to:
+
+[source,text]
+----
+Solr process PID running on port 8983
+{
+ "version":"5.0.0 - ubuntu - 2014-12-17 19:36:58",
+ "startTime":"2014-12-19T19:25:46.853Z",
+ "uptime":"0 days, 0 hours, 0 minutes, 8 seconds",
+ "memory":"85.4 MB (%17.4) of 490.7 MB"}
+----
+
+If the `status` command is not successful, look for error messages in `/var/solr/logs/solr.log`.
+
+== Fine-Tune Your Production Setup
+
+=== Dynamic Defaults for ConcurrentMergeScheduler
+
+The Merge Scheduler is configured in `solrconfig.xml` and defaults to `ConcurrentMergeScheduler`.
+This scheduler uses multiple threads to merge Lucene segments in the background.
+
+By default, the `ConcurrentMergeScheduler` auto-detects defaults for `maxThreadCount` and `maxMergeCount` accordingly.
+`maxThreadCount` is set to 4 or half the number of processors available to the JVM whichever is greater and `maxMergeCount` is set to `maxThreadCount+5`.
+
+If you have a spinning disk, it is best to explicitly set values for `maxThreadCount` and `maxMergeCount` in the xref:configuration-guide:index-segments-merging.adoc#mergescheduler[IndexConfig section of SolrConfig.xml] so that values appropriate to your hardware are used.
+
+=== Memory and GC Settings
+
+By default, the `bin/solr` script sets the maximum Java heap size to 512M (-Xmx512m), which is fine for getting started with Solr.
+For production, you’ll want to increase the maximum heap size based on the memory requirements of your search application; values between 8 and 16 gigabytes are not uncommon for production servers.
+When you need to change the memory settings for your Solr server, use the `SOLR_HEAP` variable in the include file, such as:
+
+[source,bash]
+----
+SOLR_HEAP="8g"
+----
+
+[NOTE]
+====
+Do not allocate a very large Java Heap unless you know you need it.
+See xref:jvm-settings.adoc#choosing-memory-heap-settings[Choosing Memory Heap Settings] for details.
+====
+
+Also, the xref:solr-control-script-reference.adoc[Solr Control Script] comes with a set of pre-configured Garbage First Garbage Collection settings that have shown to work well with Solr for a number of different workloads.
+However, these settings may not work well for your specific use of Solr.
+Consequently, you may need to change the GC settings, which should also be done with the `GC_TUNE` variable in the `/etc/default/solr.in.sh` include file.
+
+For more information about garbage collection settings refer to following articles:
+. https://cwiki.apache.org/confluence/display/solr/ShawnHeisey
+. https://www.oracle.com/technetwork/articles/java/g1gc-1984535.html
+
+You can also refer to xref:jvm-settings.adoc[] for tuning your memory and garbage collection settings.
+
+==== Out-of-Memory Shutdown Hook
+
+The `bin/solr` script registers the `bin/oom_solr.sh` script to be called by the JVM if an OutOfMemoryError occurs.
+The `oom_solr.sh` script will issue a `kill -9` to the Solr process that experiences the `OutOfMemoryError`.
+This behavior is recommended when running in SolrCloud mode so that ZooKeeper is immediately notified that a node has experienced a non-recoverable error.
+Take a moment to inspect the contents of the `/opt/solr/bin/oom_solr.sh` script so that you are familiar with the actions the script will perform if it is invoked by the JVM.
+
+=== Going to Production with SolrCloud
+
+To run Solr in SolrCloud mode, you need to set the `ZK_HOST` variable in the include file to point to your ZooKeeper ensemble.
+Running the embedded ZooKeeper is not supported in production environments.
+For instance, if you have a ZooKeeper ensemble hosted on the following three hosts on the default client port 2181 (zk1, zk2, and zk3), then you would set:
+
+[source,bash]
+----
+ZK_HOST=zk1,zk2,zk3
+----
+
+When the `ZK_HOST` variable is set, Solr will launch in "cloud" mode.
+
+==== ZooKeeper chroot
+
+If you're using a ZooKeeper instance that is shared by other systems, it's recommended to isolate the SolrCloud znode tree using ZooKeeper's chroot support.
+For instance, to ensure all znodes created by SolrCloud are stored under `/solr`, you can put `/solr` on the end of your `ZK_HOST` connection string, such as:
+
+[source,bash]
+----
+ZK_HOST=zk1,zk2,zk3/solr
+----
+
+Before using a chroot for the first time, you need to create the root path (znode) in ZooKeeper by using the xref:solr-control-script-reference.adoc[Solr Control Script].
+We can use the mkroot command for that:
+
+[source,bash]
+----
+bin/solr zk mkroot /solr -z <ZK_node>:<ZK_PORT>
+----
+
+[NOTE]
+====
+If you also want to bootstrap ZooKeeper with existing `solr_home`, you can instead use the `zkcli.sh` / `zkcli.bat` `bootstrap` command, which will also create the chroot path if it does not exist.
+See xref:zookeeper-utilities.adoc[] for more info.
+====
+
+=== Solr Hostname
+
+Use the `SOLR_HOST` variable in the include file to set the hostname of the Solr server.
+
+[source,bash]
+----
+SOLR_HOST=solr1.example.com
+----
+
+Setting the hostname of the Solr server is recommended, especially when running in SolrCloud mode, as this determines the address of the node when it registers with ZooKeeper.
+
+=== Environment Banner in Admin UI
+
+To guard against accidentally doing changes to the wrong cluster, you may configure a visual indication in the Admin UI of whether you currently work with a production environment or not.
+To do this, edit your `solr.in.sh` or `solr.in.cmd` file with a `-Dsolr.environment=prod` setting, or set the cluster property named `environment`.
+To specify label and/or color, use a comma-delimited format as below.
+The `+` character can be used instead of space to avoid quoting.
+Colors may be valid CSS colors or numeric, e.g., `#ff0000` for bright red.
+Examples of valid environment configs:
+
+* `prod`
+* `test,label=Functional+test`
+* `dev,label=MyDev,color=blue`
+* `dev,color=blue`
+
+=== Override Settings in solrconfig.xml
+
+Solr allows configuration properties to be overridden using Java system properties passed at startup using the `-Dproperty=value` syntax.
+For instance, in `solrconfig.xml`, the default auto soft commit settings are set to:
+
+[source,xml]
+----
+<autoSoftCommit>
+ <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
+</autoSoftCommit>
+----
+
+In general, whenever you see a property in a Solr configuration file that uses the `${solr.PROPERTY:DEFAULT_VALUE}` syntax, then you know it can be overridden using a Java system property.
+For instance, to set the maxTime for soft-commits to be 10 seconds, then you can start Solr with `-Dsolr.autoSoftCommit.maxTime=10000`, such as:
+
+[source,bash]
+----
+bin/solr start -Dsolr.autoSoftCommit.maxTime=10000
+----
+
+The `bin/solr` script simply passes options starting with `-D` on to the JVM during startup.
+For running in production, we recommend setting these properties in the `SOLR_OPTS` variable defined in the include file.
+Keeping with our soft-commit example, in `/etc/default/solr.in.sh`, you would do:
+
+[source,bash]
+----
+SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=10000"
+----
+
+=== Ulimit Settings (*nix Operating Systems)
+
+There are several settings that should be monitored and set as high as possible, "unlimited" by preference.
+On most *nix operating systems, you can see the current values by typing the following at a command prompt.
+
+[source,bash]
+----
+ulimit -a
+----
+
+These four settings in particular are important to have set very high, unlimited if possible.
+
+* max processes (`ulimit -u`): 65,000 is the recommended _minimum_.
+* file handles (`ulimit -n`): 65,000 is the recommended _minimum_.
+All the files used by all replicas have their file handles open at once so this can grow quite large.
+* virtual memory (`ulimit -v`): Set to unlimited.
+This is used to by MMapping the indexes.
+* max memory size (`ulimit -m`): Also used by MMap, set to unlimited.
+* If your system supports it, `sysctl vm.max_map_count`, should be set to unlimited as well.
+
+We strongly recommend that these settings be permanently raised.
+The exact process to permanently raise them will vary per operating system.
+Some systems require editing configuration files and restarting your server.
+Consult your system administrators for guidance in your particular environment.
+
+[WARNING]
+====
+Check these limits every time you upgrade your kernel or operating system.
+These operations can reset these to their defaults.
+====
+
+[WARNING]
+====
+If these limits are exceeded, the problems reported by Solr vary depending on the specific operation responsible for exceeding the limit.
+Errors such as "too many open files", "connection error", and "max processes exceeded" have been reported, as well as SolrCloud recovery failures.
+====
+
+=== Avoid Swapping (*nix Operating Systems)
+
+When running a Java application like Lucene/Solr, having the OS swap memory to disk is a very bad situation.
+We usually prefer a hard crash so other healthy Solr nodes can take over, instead of letting a Solr node swap, causing terrible performance, timeouts and an unstable system.
+So our recommendation is to disable swap on the host altogether or reduce the "swappiness".
+These instructions are valid for Linux environments.
+Also note that when running Solr in a Docker container, these changes must be applied to the *host*.
+
+==== Disabling Swap
+
+To disable swap on a Linux system temporarily, you can run the `swapoff` command:
+
+[source,bash]
+----
+sudo swapoff -a
+----
+
+If you want to make this setting permanent, first make sure you have more than enough physical RAM on your host and then consult the documentation for your Linux system for the correct procedure to disable swap.
+
+==== Reduce Swappiness
+
+An alternative option is to reduce the "swappiness" of your system.
+A Linux system will by default be quite aggressive in swapping out memory to disk, by having a high default "swappiness" value.
+By reducing this to a very low value, it will have almost the same effect as using `swapoff`, but Linux will still be allowed to swap in case of emergency.
+To check the current swappiness setting, run:
+
+[source,bash]
+----
+cat /proc/sys/vm/swappiness
+----
+
+Next, to change the setting permanently, open `/etc/sysctl.conf` as the root user.
+Then, change or add this line to the file:
+
+[source,bash]
+----
+vm.swappiness = 1
+----
+
+Alternatively, you can change the setting temporarily by running this comamnd:
+
+[source,bash]
+----
+echo 1 > /proc/sys/vm/swappiness
+----
+
+== Security Considerations
+
+include::securing-solr.adoc[tag=security-network-binding-1]
+
+== Running Multiple Solr Nodes per Host
+
+The `bin/solr` script is capable of running multiple instances on one machine, but for a *typical* installation, this is not a recommended setup.
+Extra CPU and memory resources are required for each additional instance.
+A single instance is easily capable of handling multiple indexes.
+
+.When to ignore the recommendation
+[NOTE]
+====
+For every recommendation, there are exceptions.
+For the recommendation above, that exception is mostly applicable when discussing extreme scalability.
+The best reason for running multiple Solr nodes on one host is decreasing the need for extremely large heaps.
+
+When the Java heap gets very large, it can result in extremely long garbage collection pauses, even with the GC tuning that the startup script provides by default.
+The exact point at which the heap is considered "very large" will vary depending on how Solr is used.
+This means that there is no hard number that can be given as a threshold, but if your heap is reaching the neighborhood of 16 to 32 gigabytes, it might be time to consider splitting nodes.
+Ideally this would mean more machines, but budget constraints might make that impossible.
+
+There is another issue once the heap reaches 32GB.
+Below 32GB, Java is able to use compressed pointers, but above that point, larger pointers are required, which uses more memory and slows down the JVM.
+
+Because of the potential garbage collection issues and the particular issues that happen at 32GB, if a single instance would require a 64GB heap, performance is likely to improve greatly if the machine is set up with two nodes that each have a 31GB heap.
+====
+
+If your use case requires multiple instances, at a minimum you will need unique Solr home directories for each node you want to run; ideally, each home should be on a different physical disk so that multiple Solr nodes don’t have to compete with each other when accessing files on disk.
+Having different Solr home directories implies that you’ll need a different include file for each node.
+Moreover, if using the `/etc/init.d/solr` script to control Solr as a service, then you’ll need a separate script for each node.
+The easiest approach is to use the service installation script to add multiple services on the same host, such as:
+
+[source,bash,subs="attributes"]
+----
- sudo bash ./install_solr_service.sh solr-{solr-docs-version}.0.tgz -s solr2 -p 8984
++sudo bash ./install_solr_service.sh solr-{solr-full-version}.tgz -s solr2 -p 8984
+----
+
+The command shown above will add a service named `solr2` running on port 8984 using `/var/solr2` for writable (aka "live") files; the second server will still be owned and run by the `solr` user and will use the Solr distribution files in `/opt`.
+After installing the solr2 service, verify it works correctly by doing:
+
+[source,bash]
+----
+sudo service solr2 restart
+sudo service solr2 status
+----
diff --cc solr/solr-ref-guide/modules/getting-started/pages/tutorial-aws.adoc
index 75fbe6b,0000000..6439c5f
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-aws.adoc
+++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-aws.adoc
@@@ -1,305 -1,0 +1,305 @@@
+= SolrCloud on AWS EC2
+:experimental:
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+This guide is a tutorial on how to set up a multi-node SolrCloud cluster on https://aws.amazon.com/ec2[Amazon Web Services (AWS) EC2] instances for early development and design.
+
+This tutorial is not meant for production systems.
+For one, it uses Solr's embedded ZooKeeper instance, and for production you should have at least 3 ZooKeeper nodes in an ensemble.
+There are additional steps you should take for a production installation; refer to xref:deployment-guide:taking-solr-to-production.adoc[] for how to deploy Solr in production.
+
+In this guide we are going to:
+
+. Launch multiple AWS EC2 instances
+* Create new _Security Group_
+* Configure instances and launch
+. Install, configure and start Solr on newly launched EC2 instances
+* Install system prerequisites: Java 1.8 and later
+* Download latest version of Solr
+* Start the Solr nodes in SolrCloud mode
+. Create a collection, index documents and query the system
+* Create collection with multiple shards and replicas
+* Index documents to the newly created collection
+* Verify documents presence by querying the collection
+
+== Before You Start
+To use this guide, you must have the following:
+
+* An https://aws.amazon.com[AWS] account.
+* Familiarity with setting up a single-node SolrCloud on local machine.
+Refer to the xref:solr-tutorial.adoc[] if you have never used Solr before.
+
+== Launch EC2 instances
+
+=== Create new Security Group
+
+. Navigate to the https://console.aws.amazon.com/ec2/v2/home[AWS EC2 console] and to the region of your choice.
+. Configure an http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html[AWS security group] which will limit access to the installation and allow our launched EC2 instances to talk to each other without restrictions.
+.. From the EC2 Dashboard, click btn:[Security Groups] from the left-hand menu, under "Network & Security".
+.. Click btn:[Create Security Group] under the _Security Groups_ section.
+ Give your security group a descriptive name.
+.. You can select one of the existing https://aws.amazon.com/vpc[VPCs] or create a new one.
+.. We need two ports open for our cloud here:
+... Solr port.
+In this example we will use Solr's default port 8983.
+... ZooKeeper Port: We'll use Solr's embedded ZooKeeper, so we'll use the default port 9983 (see the <<Deploying with External ZooKeeper>> to configure external ZooKeeper).
+.. Click btn:[Inbound] to set inbound network rules, then select btn:[Add Rule].
+Select "Custom TCP" as the type.
+Enter `8983` for the "Port Range" and choose "My IP for the Source, then enter your public IP.
+Create a second rule with the same type and source, but enter `9983` for the port.
++
+This will limit access to your current machine.
+If you want wider access to the instance in order to collaborate with others, you can specify that, but make sure you only allow as much access as needed.
+A Solr instance should never be exposed to general Internet traffic.
+.. Add another rule for SSH access.
+Choose "SSH" as the type, and again "My IP" for the source and again enter your public IP.
+You need SSH access on all instances to install and configure Solr.
+.. Review the details, your group configuration should look like this:
++
+image::tutorial-aws/aws-security-create.png[image,width=600,height=400]
+.. Click btn:[Create] when finished.
+.. We need to modify the rules so that instances that are part of the group can talk to all other instances that are part of the same group.
+We could not do this while creating the group, so we need to edit the group after creating it to add this.
+... Select the newly created group in the Security Group overview table.
+Under the "Inbound" tab, click btn:[Edit].
+... Click btn:[Add rule].
+Choose `All TCP` from the pulldown list for the type, and enter `0-65535` for the port range.
+Specify the name of the current Security Group as the `solr-sample`.
+.. Review the details, your group configuration should now look like this:
++
+image::tutorial-aws/aws-security-edit.png[image,width=600,height=400]
+.. Click btn:[Save] when finished.
+
+=== Configure Instances and Launch
+
+Once the security group is in place, you can choose btn:[Instances] from the left-hand navigation menu.
+
+Under Instances, click btn:[Launch Instance] button and follow the wizard steps:
+
+. Choose your Amazon Machine Image (AMI):
+Choose *Amazon Linux AMI, SSD Volume Type* as the AMI.
+There are both commercial AMIs and Community based AMIs available, e.g., Amazon Linux AMI (HVM), SSD Volume Type, but this is a nice AMI to use for our purposes.
+Click btn:[Select] next to the image you choose.
+. The next screen asks you to choose the instance type, *t2.medium* is sufficient.
+Choose it from the list, then click btn:[Configure Instance Details].
+. Configure the instance.
+Enter *2* in the "Number of instances" field.
+Make sure the setting for "Auto-assign Public IP" is "Enabled".
+. When finished, click btn:[Add Storage].
+The default of *8 GB* for size and *General Purpose SSD* for the volume type is sufficient for running this quick start.
+Optionally select "Delete on termination" if you know you won't need the data stored in Solr indexes after you terminate the instances.
+. When finished, click btn:[Add Tags].
+You do not have to add any tags for this quick start, but you can add them if you want.
+ . Click btn:[Configure Security Group].
+ Choose *Select an existing security group* and select the security group you created earlier: `solr-sample`.
+ You should see the expected inbound rules at the bottom of the page.
+. Click btn:[Review].
+. If everything looks correct, click btn:[Launch].
+. Select an existing “private key file” or create a new one and download to your local machine so you will be able to login into the instances via SSH.
++
+image::tutorial-aws/aws-key.png[image,width=600,height=400]
+. On the instances list, you can watch the states change.
+You cannot use the instances until they become *“running”*.
+
+
+== Install, Configure and Start
+
+. Locate the Public DNS record for the instance by selecting the instance from the list of instances, and log on to each machine one by one.
++
+Using SSH, if your AWS identity key file is `aws-key.pem` and the AMI uses `ec2-user` as login user, on each AWS instance, do the following:
++
+[source,bash]
+$ ssh-add aws-key.pem
+$ ssh -A ec2-user@<instance-public-dns>
++
+. While logged in to each of the AWS EC2 instances, configure Java 1.8 and download Solr:
++
+[source,bash]
+# verify default java version packaged with AWS instances is 1.7
+$ java -version
+$ sudo yum install java-1.8.0
+$ sudo /usr/sbin/alternatives --config java
+# select jdk-1.8
+# verify default java version to java-1.8
+$ java -version
++
+[source,bash,subs="verbatim,attributes+"]
+# download desired version of Solr
- $ wget http://archive.apache.org/dist/lucene/solr/{solr-docs-version}.0/solr-{solr-docs-version}.0.tgz
++$ wget http://archive.apache.org/dist/lucene/solr/{solr-full-version}/solr-{solr-full-version}.tgz
+# untar
- $ tar -zxvf solr-{solr-docs-version}.0.tgz
++$ tar -zxvf solr-{solr-full-version}.tgz
+# set SOLR_HOME
- $ export SOLR_HOME=$PWD/solr-{solr-docs-version}.0
++$ export SOLR_HOME=$PWD/solr-{solr-full-version}
+# put the env variable in .bashrc
+# vim ~/.bashrc
- export SOLR_HOME=/home/ec2-user/solr-{solr-docs-version}.0
++export SOLR_HOME=/home/ec2-user/solr-{solr-full-version}
+
+. Resolve the Public DNS to simpler hostnames.
++
+Let’s assume AWS instances public DNS with IPv4 Public IP are as follows:
++
+* ec2-54-1-2-3.us-east-2.compute.amazonaws.com: 54.1.2.3
+* ec2-54-4-5-6.us-east-2.compute.amazonaws.com: 54.4.5.6
++
+Edit `/etc/hosts`, and add entries for the above machines:
++
+[source,bash]
+$ sudo vim /etc/hosts
+54.1.2.3 solr-node-1
+54.4.5.6 solr-node-2
+
+. Configure Solr in running EC2 instances.
++
+In this case, one of the machines will host ZooKeeper embedded along with Solr node, say, `ec2-101-1-2-3.us-east-2.compute.amazonaws.com` (aka, `solr-node-1`)
++
+See <<Deploying with External ZooKeeper>> for configure external ZooKeeper.
++
+Inside the `ec2-101-1-2-3.us-east-2.compute.amazonaws.com` (`solr-node-1`)
++
+[source,bash]
+$ cd $SOLR_HOME
+# start Solr node on 8983 and ZooKeeper will start on 8983+1000 9983
+$ bin/solr start -c -p 8983 -h solr-node-1
+
++
+On the other node, `ec2-101-4-5-6.us-east-2.compute.amazonaws.com` (`solr-node-2`)
++
+[source,bash]
+$ cd $SOLR_HOME
+# start Solr node on 8983 and connect to ZooKeeper running on first node
+$ bin/solr start -c -p 8983 -h solr-node-2 -z solr-node-1:9983
+
+. Inspect and Verify.
+Inspect the Solr nodes state from browser on local machine:
++
+Go to:
++
+[source,bash]
+----
+http://ec2-101-1-2-3.us-east-2.compute.amazonaws.com:8983/solr (solr-node-1:8983/solr)
+
+http://ec2-101-4-5-6.us-east-2.compute.amazonaws.com:8983/solr (solr-node-2:8983/solr)
+----
++
+You should able to see Solr UI dashboard for both nodes.
+
+== Create Collection, Index and Query
+
+You can refer to the xref:solr-tutorial.adoc[] for an extensive walkthrough on creating collections with multiple shards and replicas, indexing data via different methods and querying documents accordingly.
+
+== Deploying with External ZooKeeper
+
+If you want to configure an external ZooKeeper ensemble to avoid using the embedded single-instance ZooKeeper that runs in the same JVM as the Solr node, you need to make few tweaks in the above listed steps as follows.
+
+* When creating the security group, instead of opening port `9983` for ZooKeeper, you'll open `2181` (or whatever port you are using for ZooKeeper: its default is 2181).
+* When configuring the number of instances to launch, choose to open 3 instances instead of 2.
+* When modifying the `/etc/hosts` on each machine, add a third line for the 3rd instance and give it a recognizable name:
++
+[source,text,subs="verbatim"]
+$ sudo vim /etc/hosts
+54.1.2.3 solr-node-1
+54.4.5.6 solr-node-2
+54.7.8.9 zookeeper-node
+
+* You'll need to install ZooKeeper manually, described in the next section.
+
+=== Install ZooKeeper
+
+These steps will help you install and configure a single instance of ZooKeeper on AWS.
+This is not sufficient for a production, use, however, where a ZooKeeper ensemble of at least three nodes is recommended.
+See the section xref:deployment-guide:zookeeper-ensemble.adoc[] for information about how to change this single-instance into an ensemble.
+
+. Download a stable version of ZooKeeper.
+In this example we're using ZooKeeper v{dep-version-zookeeper}.
+On the node you're using to host ZooKeeper (`zookeeper-node`), download the package and untar it:
++
+[source,bash,subs="attributes"]
+----
+# download stable version of ZooKeeper, here {dep-version-zookeeper}
+$ wget https://archive.apache.org/dist/zookeeper/zookeeper-{dep-version-zookeeper}/zookeeper-{dep-version-zookeeper}.tar.gz
+# untar
+$ tar -zxvf zookeeper-{dep-version-zookeeper}.tar.gz
+----
++
+Add an environment variable for ZooKeeper's home directory (`ZOO_HOME`) to the `.bashrc` for the user who will be running the process.
+The rest of the instructions assume you have set this variable.
+Correct the path to the ZooKeeper installation as appropriate if where you put it does not match the below.
++
+[source,bash,subs="attributes"]
+----
+$ export ZOO_HOME=$PWD/zookeeper-{dep-version-zookeeper}
+# put the env variable in .bashrc
+# vim ~/.bashrc
+export ZOO_HOME=/home/ec2-user/zookeeper-{dep-version-zookeeper}
+----
+. Change directories to `ZOO_HOME`, and create the ZooKeeper configuration by using the template provided by ZooKeeper.
++
+[source,bash]
+----
+$ cd $ZOO_HOME
+# create ZooKeeper config by using zoo_sample.cfg
+$ cp conf/zoo_sample.cfg conf/zoo.cfg
+----
+. Create the ZooKeeper data directory in the filesystem, and edit the `zoo.cfg` file to uncomment the autopurge parameters and define the location of the data directory.
++
+[source,bash]
+----
+# create data dir for ZooKeeper, edit zoo.cfg, uncomment autopurge parameters
+$ mkdir data
+$ vim conf/zoo.cfg
+# -- uncomment --
+autopurge.snapRetainCount=3
+autopurge.purgeInterval=1
+# -- edit --
+dataDir=data
+----
+. Start ZooKeeper.
++
+[source,bash]
+----
+$ cd $ZOO_HOME
+# start ZooKeeper, default port: 2181
+$ bin/zkServer.sh start
+----
+
+. On the first node being used for Solr (`solr-node-1`), start Solr and tell it where to find ZooKeeper.
++
+[source,bash]
+----
+$ cd $SOLR_HOME
+# start Solr node on 8983 and connect to ZooKeeper running on ZooKeeper node
+$ bin/solr start -c -p 8983 -h solr-node-1 -z zookeeper-node:2181
+----
++
+. On the second Solr node (`solr-node-2`), again start Solr and tell it where to find ZooKeeper.
++
+[source,bash]
+----
+$ cd $SOLR_HOME
+# start Solr node on 8983 and connect to ZooKeeper running on ZooKeeper node
+$ bin/solr start -c -p 8983 -h solr-node-1 -z zookeeper-node:2181
+----
+
+[TIP]
+====
+As noted earlier, a single ZooKeeper node is not sufficient for a production installation.
+See these additional resources for more information about deploying Solr in production, which can be used once you have the EC2 instances up and running:
+
+* xref:deployment-guide:taking-solr-to-production.adoc[]
+* xref:deployment-guide:zookeeper-ensemble.adoc[]
+====
diff --cc solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc
index bbc8370,0000000..e539564
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc
+++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-films.adoc
@@@ -1,462 -1,0 +1,462 @@@
+= Exercise 2 Index Films Data
+:experimental:
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+[[exercise-2]]
+== Exercise 2: Modify the Schema and Index Films Data
+
+This exercise will build on the last one and introduce you to the index schema and Solr's powerful faceting features.
+
+=== Restart Solr
+
+Did you stop Solr after the last exercise? No?
+Then go ahead to the next section.
+
+If you did, though, and need to restart Solr, issue these commands:
+
+`./bin/solr start -c -p 8983 -s example/cloud/node1/solr`
+
+This starts the first node.
+When it's done start the second node, and tell it how to connect to ZooKeeper:
+
+`./bin/solr start -c -p 7574 -s example/cloud/node2/solr -z localhost:9983`
+
+NOTE: If you have defined `ZK_HOST` in `solr.in.sh`/`solr.in.cmd` (see xref:deployment-guide:zookeeper-ensemble#updating-solr-include-files[Updating Solr Include Files]) you can omit `-z <zk host string>` from the above command.
+
+=== Create a New Collection
+
+We're going to use a whole new data set in this exercise, so it would be better to have a new collection instead of trying to reuse the one we had before.
+
+One reason for this is we're going to use a feature in Solr called "field guessing", where Solr attempts to guess what type of data is in a field while it's indexing it.
+It also automatically creates new fields in the schema for new fields that appear in incoming documents.
+This mode is called "Schemaless".
+We'll see the benefits and limitations of this approach to help you decide how and where to use it in your real application.
+
+.What is a "schema" and why do I need one?
+[sidebar]
+****
+Solr's schema is a single file (in XML) that stores the details about the fields and field types Solr is expected to understand.
+The schema defines not only the field or field type names, but also any modifications that should happen to a field before it is indexed.
+For example, if you want to ensure that a user who enters "abc" and a user who enters "ABC" can both find a document containing the term "ABC", you will want to normalize (lower-case, in this case) "ABC" when it is indexed, and normalize the user query to be sure of a match.
+These rules are defined in your schema.
+
+Earlier in the tutorial we mentioned copy fields, which are fields made up of data that originated from other fields.
+You can also define dynamic fields, which use wildcards (such as `*_t` or `*_s`) to dynamically create fields of a specific field type.
+These types of rules are also defined in the schema.
+****
+
+When you initially started Solr in the first exercise, we had a choice of a configset to use.
+The one we chose had a schema that was pre-defined for the data we later indexed.
+This time, we're going to use a configset that has a very minimal schema and let Solr figure out from the data what fields to add.
+
+The data you're going to index is related to movies, so start by creating a collection named "films" that uses the `_default` configset:
+
+`bin/solr create -c films -s 2 -rf 2`
+
+Whoa, wait.
+We didn't specify a configset!
+That's fine, the `_default` is appropriately named, since it's the default and is used if you don't specify one at all.
+
+We did, however, set two parameters `-s` and `-rf`.
+Those are the number of shards to split the collection across (2) and how many replicas to create (2).
+This is equivalent to the options we had during the interactive example from the first exercise.
+
+You should see output like:
+
+[source,subs="verbatim,attributes+"]
+----
+WARNING: Using _default configset. Data driven schema functionality is enabled by default, which is
+ NOT RECOMMENDED for production use.
+
+ To turn it off:
+ bin/solr config -c films -p 7574 -action set-user-property -property update.autoCreateFields -value false
+
+Connecting to ZooKeeper at localhost:9983 ...
+INFO - 2017-07-27 15:07:46.191; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready
- Uploading /{solr-docs-version}.0/server/solr/configsets/_default/conf for config films to ZooKeeper at localhost:9983
++Uploading /{solr-full-version}/server/solr/configsets/_default/conf for config films to ZooKeeper at localhost:9983
+
+Creating new collection 'films' using command:
+http://localhost:7574/solr/admin/collections?action=CREATE&name=films&numShards=2&replicationFactor=2&collection.configName=films
+
+{
+ "responseHeader":{
+ "status":0,
+ "QTime":3830},
+ "success":{
+ "192.168.0.110:8983_solr":{
+ "responseHeader":{
+ "status":0,
+ "QTime":2076},
+ "core":"films_shard2_replica_n1"},
+ "192.168.0.110:7574_solr":{
+ "responseHeader":{
+ "status":0,
+ "QTime":2494},
+ "core":"films_shard1_replica_n2"}}}
+----
+
+The first thing the command printed was a warning about not using this configset in production.
+That's due to some of the limitations we'll cover shortly.
+
+Otherwise, though, the collection should be created.
+If we go to the Admin UI at http://localhost:8983/solr/#/films/collection-overview we should see the overview screen.
+
+==== Preparing Schemaless for the Films Data
+
+There are two parallel things happening with the schema that comes with the `_default` configset.
+
+First, we are using a "managed schema", which is configured to only be modified by Solr's Schema API.
+That means we should not hand-edit it so there isn't confusion about which edits come from which source.
+Solr's Schema API allows us to make changes to fields, field types, and other types of schema rules.
+
+Second, we are using "field guessing", which is configured in the `solrconfig.xml` file (and includes most of Solr's various configuration settings).
+Field guessing is designed to allow us to start using Solr without having to define all the fields we think will be in our documents before trying to index them.
+This is why we call it "schemaless", because you can start quickly and let Solr create fields for you as it encounters them in documents.
+
+Sounds great!
+Well, not really, there are limitations.
+It's a bit brute force, and if it guesses wrong, you can't change much about a field after data has been indexed without having to reindex.
+If we only have a few thousand documents that might not be bad, but if you have millions and millions of documents, or, worse, don't have access to the original data anymore, this can be a real problem.
+
+For these reasons, the Solr community does not recommend going to production without a schema that you have defined yourself.
+By this we mean that the schemaless features are fine to start with, but you should still always make sure your schema matches your expectations for how you want your data indexed and how users are going to query it.
+
+It is possible to mix schemaless features with a defined schema.
+Using the Schema API, you can define a few fields that you know you want to control, and let Solr guess others that are less important or which you are confident (through testing) will be guessed to your satisfaction.
+That's what we're going to do here.
+
+===== Create the "names" Field
+The films data we are going to index has a small number of fields for each movie: an ID, director name(s), film name, release date, and genre(s).
+
+If you look at one of the files in `example/films`, you'll see the first film is named _.45_, released in 2006.
+As the first document in the dataset, Solr is going to guess the field type based on the data in the record.
+If we go ahead and index this data, that first film name is going to indicate to Solr that the field type is a "float" numeric field, and will create a "name" field with a type `FloatPointField`.
+All data after this record will be expected to be a float.
+
+Well, that's not going to work.
+We have titles like _A Mighty Wind_ and _Chicken Run_, which are strings - decidedly not numeric and not floats.
+If we let Solr guess the "name" field is a float, what will happen is later titles will cause an error and indexing will fail.
+That's not going to get us very far.
+
+What we can do is set up the "name" field in Solr before we index the data to be sure Solr always interprets it as a string.
+At the command line, enter this curl command:
+
+[source,bash]
+curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field": {"name":"name", "type":"text_general", "multiValued":false, "stored":true}}' http://localhost:8983/solr/films/schema
+
+This command uses the Schema API to explicitly define a field named "name" that has the field type "text_general" (a text field).
+It will not be permitted to have multiple values, but it will be stored (meaning it can be retrieved by queries).
+
+You can also use the Admin UI to create fields, but it offers a bit less control over the properties of your field.
+It will work for our case, though:
+
+.Creating a field
+image::solr-tutorial/tutorial-add-field.png[Adding a Field,640,480,pdfwidth=75%]
+
+===== Create a "catchall" Copy Field
+
+There's one more change to make before we start indexing.
+
+In the first exercise when we queried the documents we had indexed, we didn't have to specify a field to search because the configuration we used was set up to copy fields into a `text` field, and that field was the default when no other field was defined in the query.
+
+The configuration we're using now doesn't have that rule.
+We would need to define a field to search for every query.
+We can, however, set up a "catchall field" by defining a copy field that will take all data from all fields and index it into a field named `\_text_`.
+Let's do that now.
+
+You can use either the Admin UI or the Schema API for this.
+
+At the command line, use the Schema API again to define a copy field:
+
+[source,bash]
+curl -X POST -H 'Content-type:application/json' --data-binary '{"add-copy-field" : {"source":"*","dest":"_text_"}}' http://localhost:8983/solr/films/schema
+
+In the Admin UI, choose btn:[Add Copy Field], then fill out the source and destination for your field, as in this screenshot.
+
+.Creating a copy field
+image::solr-tutorial/tutorial-add-copy-field.png[Adding a copy field,640,480,pdfwidth=75%]
+
+What this does is make a copy of all fields and put the data into the "\_text_" field.
+
+TIP: It can be very expensive to do this with your production data because it tells Solr to effectively index everything twice.
+It will make indexing slower, and make your index larger.
+With your production data, you will want to be sure you only copy fields that really warrant it for your application.
+
+OK, now we're ready to index the data and start playing around with it.
+
+=== Index Sample Film Data
+
+The films data we will index is located in the `example/films` directory of your installation.
+It comes in three formats: JSON, XML and CSV.
+Pick one of the formats and index it into the "films" collection (in each example, one command is for Unix/MacOS and the other is for Windows):
+
+.To Index JSON Format
+[source,subs="verbatim,attributes+"]
+----
+bin/post -c films example/films/films.json
+
- C:\solr-{solr-docs-version}.0> java -jar -Dc=films -Dauto example\exampledocs\post.jar example\films\*.json
++C:\solr-{solr-full-version}> java -jar -Dc=films -Dauto example\exampledocs\post.jar example\films\*.json
+----
+
+.To Index XML Format
+[source,subs="verbatim,attributes+"]
+----
+bin/post -c films example/films/films.xml
+
- C:\solr-{solr-docs-version}.0> java -jar -Dc=films -Dauto example\exampledocs\post.jar example\films\*.xml
++C:\solr-{solr-full-version}> java -jar -Dc=films -Dauto example\exampledocs\post.jar example\films\*.xml
+----
+
+.To Index CSV Format
+[source,subs="verbatim,attributes+"]
+----
+bin/post -c films example/films/films.csv -params "f.genre.split=true&f.directed_by.split=true&f.genre.separator=|&f.directed_by.separator=|"
+
- C:\solr-{solr-docs-version}.0> java -jar -Dc=films -Dparams=f.genre.split=true&f.directed_by.split=true&f.genre.separator=|&f.directed_by.separator=| -Dauto example\exampledocs\post.jar example\films\*.csv
++C:\solr-{solr-full-version}> java -jar -Dc=films -Dparams=f.genre.split=true&f.directed_by.split=true&f.genre.separator=|&f.directed_by.separator=| -Dauto example\exampledocs\post.jar example\films\*.csv
+----
+
+Each command includes these main parameters:
+
+* `-c films`: this is the Solr collection to index data to.
+* `example/films/films.json` (or `films.xml` or `films.csv`): this is the path to the data file to index.
+You could simply supply the directory where this file resides, but since you know the format you want to index, specifying the exact file for that format is more efficient.
+
+Note the CSV command includes extra parameters.
+This is to ensure multi-valued entries in the "genre" and "directed_by" columns are split by the pipe (`|`) character, used in this file as a separator.
+Telling Solr to split these columns this way will ensure proper indexing of the data.
+
+Each command will produce output similar to the below seen while indexing JSON:
+
+[source,bash,subs="verbatim,attributes"]
+----
+$ ./bin/post -c films example/films/films.json
- /bin/java -classpath /solr-{solr-docs-version}.0/server/solr-webapp/webapp/WEB-INF/lib/solr-core-{solr-docs-version}.0.jar -Dauto=yes -Dc=films -Ddata=files org.apache.solr.util.SimplePostTool example/films/films.json
++/bin/java -classpath /solr-{solr-full-version}/server/solr-webapp/webapp/WEB-INF/lib/solr-core-{solr-full-version}.jar -Dauto=yes -Dc=films -Ddata=files org.apache.solr.util.SimplePostTool example/films/films.json
+SimplePostTool version 5.0.0
+Posting files to [base] url http://localhost:8983/solr/films/update...
+Entering auto mode. File endings considered are xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
+POSTing file films.json (application/json) to [base]/json/docs
+1 files indexed.
+COMMITting Solr index changes to http://localhost:8983/solr/films/update...
+Time spent: 0:00:00.878
+----
+
+Hooray!
+
+If you go to the Query screen in the Admin UI for films (http://localhost:8983/solr/#/films/query) and hit btn:[Execute Query] you should see 1100 results, with the first 10 returned to the screen.
+
+Let's do a query to see if the "catchall" field worked properly.
+Enter "comedy" in the `q` box and hit btn:[Execute Query] again.
+You should see 417 results.
+Feel free to play around with other searches before we move on to faceting.
+
+[[tutorial-faceting]]
+=== Faceting
+
+One of Solr's most popular features is faceting.
+Faceting allows the search results to be arranged into subsets (or buckets, or categories), providing a count for each subset.
+There are several types of faceting: field values, numeric and date ranges, pivots (decision tree), and arbitrary query faceting.
+
+==== Field Facets
+
+In addition to providing search results, a Solr query can return the number of documents that contain each unique value in the whole result set.
+
+On the Admin UI Query tab, if you check the `facet` checkbox, you'll see a few facet-related options appear:
+
+.Facet options in the Query screen
+image::solr-tutorial/tutorial-admin-ui-facet-options.png[Solr Quick Start: Query tab facet options]
+
+To see facet counts from all documents (`q=\*:*`): turn on faceting (`facet=true`), and specify the field to facet on via the `facet.field` parameter.
+If you only want facets, and no document contents, specify `rows=0`.
+The `curl` command below will return facet counts for the `genre_str` field:
+
+`curl "http://localhost:8983/solr/films/select?q=\*:*&rows=0&facet=true&facet.field=genre_str"`
+
+In your terminal, you'll see something like:
+
+[source,json]
+{
+ "responseHeader":{
+ "zkConnected":true,
+ "status":0,
+ "QTime":11,
+ "params":{
+ "q":"*:*",
+ "facet.field":"genre_str",
+ "rows":"0",
+ "facet":"true"}},
+ "response":{"numFound":1100,"start":0,"maxScore":1.0,"docs":[]
+ },
+ "facet_counts":{
+ "facet_queries":{},
+ "facet_fields":{
+ "genre_str":[
+ "Drama",552,
+ "Comedy",389,
+ "Romance Film",270,
+ "Thriller",259,
+ "Action Film",196,
+ "Crime Fiction",170,
+ "World cinema",167]},
+ "facet_ranges":{},
+ "facet_intervals":{},
+ "facet_heatmaps":{}}}
+
+We've truncated the output here a little bit, but in the `facet_counts` section, you see by default you get a count of the number of documents using each genre for every genre in the index.
+Solr has a parameter `facet.mincount` that you could use to limit the facets to only those that contain a certain number of documents (this parameter is not shown in the UI).
+Or, perhaps you do want all the facets, and you'll let your application's front-end control how it's displayed to users.
+
+If you wanted to control the number of items in a bucket, you could do something like this:
+
+`curl "http://localhost:8983/solr/films/select?=&q=\*:*&facet.field=genre_str&facet.mincount=200&facet=on&rows=0"`
+
+You should only see 4 facets returned.
+
+There are a great deal of other parameters available to help you control how Solr constructs the facets and facet lists.
+We'll cover some of them in this exercise, but you can also see the section xref:query-guide:faceting.adoc[] for more detail.
+
+==== Range Facets
+
+For numerics or dates, it's often desirable to partition the facet counts into ranges rather than discrete values.
+A prime example of numeric range faceting, using the example techproducts data from our previous exercise, is `price`.
+The films data includes the release date for films, and we could use that to create date range facets, which are another common use for range facets.
+
+The Solr Admin UI doesn't yet support range facet options, so you will need to use curl or similar command line tool for the following examples.
+
+If we construct a query that looks like this:
+
+[source,bash]
+curl 'http://localhost:8983/solr/films/select?q=*:*&rows=0'\
+ '&facet=true'\
+ '&facet.range=initial_release_date'\
+ '&facet.range.start=NOW-20YEAR'\
+ '&facet.range.end=NOW'\
+ '&facet.range.gap=%2B1YEAR'
+
+This will request all films and ask for them to be grouped by year starting with 20 years ago (our earliest release date is in 2000) and ending today.
+Note that this query again URL encodes a `+` as `%2B`.
+
+In the terminal you will see:
+
+[source,json]
+{
+ "responseHeader":{
+ "zkConnected":true,
+ "status":0,
+ "QTime":8,
+ "params":{
+ "facet.range":"initial_release_date",
+ "facet.limit":"300",
+ "q":"*:*",
+ "facet.range.gap":"+1YEAR",
+ "rows":"0",
+ "facet":"on",
+ "facet.range.start":"NOW-20YEAR",
+ "facet.range.end":"NOW"}},
+ "response":{"numFound":1100,"start":0,"maxScore":1.0,"docs":[]
+ },
+ "facet_counts":{
+ "facet_queries":{},
+ "facet_fields":{},
+ "facet_ranges":{
+ "initial_release_date":{
+ "counts":[
+ "1997-07-28T17:12:06.919Z",0,
+ "1998-07-28T17:12:06.919Z",0,
+ "1999-07-28T17:12:06.919Z",48,
+ "2000-07-28T17:12:06.919Z",82,
+ "2001-07-28T17:12:06.919Z",103,
+ "2002-07-28T17:12:06.919Z",131,
+ "2003-07-28T17:12:06.919Z",137,
+ "2004-07-28T17:12:06.919Z",163,
+ "2005-07-28T17:12:06.919Z",189,
+ "2006-07-28T17:12:06.919Z",92,
+ "2007-07-28T17:12:06.919Z",26,
+ "2008-07-28T17:12:06.919Z",7,
+ "2009-07-28T17:12:06.919Z",3,
+ "2010-07-28T17:12:06.919Z",0,
+ "2011-07-28T17:12:06.919Z",0,
+ "2012-07-28T17:12:06.919Z",1,
+ "2013-07-28T17:12:06.919Z",1,
+ "2014-07-28T17:12:06.919Z",1,
+ "2015-07-28T17:12:06.919Z",0,
+ "2016-07-28T17:12:06.919Z",0],
+ "gap":"+1YEAR",
+ "start":"1997-07-28T17:12:06.919Z",
+ "end":"2017-07-28T17:12:06.919Z"}},
+ "facet_intervals":{},
+ "facet_heatmaps":{}}}
+
+==== Pivot Facets
+
+Another faceting type is pivot facets, also known as "decision trees", allowing two or more fields to be nested for all the various possible combinations.
+Using the films data, pivot facets can be used to see how many of the films in the "Drama" category (the `genre_str` field) are directed by a director.
+Here's how to get at the raw data for this scenario:
+
+`curl "http://localhost:8983/solr/films/select?q=\*:*&rows=0&facet=on&facet.pivot=genre_str,directed_by_str"`
+
+This results in the following response, which shows a facet for each category and director combination:
+
+[source,json]
+{"responseHeader":{
+ "zkConnected":true,
+ "status":0,
+ "QTime":1147,
+ "params":{
+ "q":"*:*",
+ "facet.pivot":"genre_str,directed_by_str",
+ "rows":"0",
+ "facet":"on"}},
+ "response":{"numFound":1100,"start":0,"maxScore":1.0,"docs":[]
+ },
+ "facet_counts":{
+ "facet_queries":{},
+ "facet_fields":{},
+ "facet_ranges":{},
+ "facet_intervals":{},
+ "facet_heatmaps":{},
+ "facet_pivot":{
+ "genre_str,directed_by_str":[{
+ "field":"genre_str",
+ "value":"Drama",
+ "count":552,
+ "pivot":[{
+ "field":"directed_by_str",
+ "value":"Ridley Scott",
+ "count":5},
+ {
+ "field":"directed_by_str",
+ "value":"Steven Soderbergh",
+ "count":5},
+ {
+ "field":"directed_by_str",
+ "value":"Michael Winterbottom",
+ "count":4}]}]}}}
+
+We've truncated this output as well - you will see a lot of genres and directors in your screen.
+
+=== Exercise 2 Wrap Up
+
+In this exercise, we learned a little bit more about how Solr organizes data in the indexes, and how to work with the Schema API to manipulate the schema file.
+We also learned a bit about facets in Solr, including range facets and pivot facets.
+In both of these things, we've only scratched the surface of the available options.
+If you can dream it, it might be possible!
+
+Like our previous exercise, this data may not be relevant to your needs.
+We can clean up our work by deleting the collection.
+To do that, issue this command at the command line:
+
+`bin/solr delete -c films`
diff --cc solr/solr-ref-guide/modules/getting-started/pages/tutorial-techproducts.adoc
index 91bdad1a,0000000..c2bfbb4
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/getting-started/pages/tutorial-techproducts.adoc
+++ b/solr/solr-ref-guide/modules/getting-started/pages/tutorial-techproducts.adoc
@@@ -1,509 -1,0 +1,509 @@@
+= Exercise 1 Index Techproducts Data
+:experimental:
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+This exercise will walk you through how to start Solr as a two-node cluster (both nodes on the same machine) and create a collection during startup.
+Then you will index some sample data that ships with Solr and do some basic searches.
+
+== Launch Solr in SolrCloud Mode
+To launch Solr, run: `bin/solr start -e cloud` on Unix or MacOS; `bin\solr.cmd start -e cloud` on Windows.
+
+This will start an interactive session that will start two Solr "servers" on your machine.
+This command has an option to run without prompting you for input (`-noprompt`), but we want to modify two of the defaults so we won't use that option now.
+
+[source,subs="verbatim,attributes+"]
+----
- solr-{solr-docs-version}.0:$ ./bin/solr start -e cloud
++solr-{solr-full-version}:$ ./bin/solr start -e cloud
+
+Welcome to the SolrCloud example!
+
+This interactive session will help you launch a SolrCloud cluster on your local workstation.
+To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2]:
+----
+The first prompt asks how many nodes we want to run.
+Note the `[2]` at the end of the last line; that is the default number of nodes.
+Two is what we want for this example, so you can simply press kbd:[enter].
+
+[source,subs="verbatim,attributes+"]
+----
+Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
+Please enter the port for node1 [8983]:
+----
+This will be the port that the first node runs on.
+Unless you know you have something else running on port 8983 on your machine, accept this default option also by pressing kbd:[enter].
+If something is already using that port, you will be asked to choose another port.
+
+[source,subs="verbatim,attributes+"]
+----
+Please enter the port for node2 [7574]:
+----
+This is the port the second node will run on.
+Again, unless you know you have something else running on port 7574 on your machine, accept this default option also by pressing kbd:[enter].
+If something is already using that port, you will be asked to choose another port.
+
+Solr will now initialize itself and start running on those two nodes.
+The script will print the commands it uses for your reference.
+
+[source,subs="verbatim,attributes+"]
+----
+Starting up 2 Solr nodes for your example SolrCloud cluster.
+
- Creating Solr home directory /solr-{solr-docs-version}.0/example/cloud/node1/solr
- Cloning /solr-{solr-docs-version}.0/example/cloud/node1 into
- /solr-{solr-docs-version}.0/example/cloud/node2
++Creating Solr home directory /solr-{solr-full-version}/example/cloud/node1/solr
++Cloning /solr-{solr-full-version}/example/cloud/node1 into
++ /solr-{solr-full-version}/example/cloud/node2
+
+Starting up Solr on port 8983 using command:
+"bin/solr" start -cloud -p 8983 -s "example/cloud/node1/solr"
+
+Waiting up to 180 seconds to see Solr running on port 8983 [\]
+Started Solr server on port 8983 (pid=34942). Happy searching!
+
+
+Starting up Solr on port 7574 using command:
+"bin/solr" start -cloud -p 7574 -s "example/cloud/node2/solr" -z localhost:9983
+
+Waiting up to 180 seconds to see Solr running on port 7574 [\]
+Started Solr server on port 7574 (pid=35036). Happy searching!
+
+INFO - 2017-07-27 12:28:02.835; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready
+----
+
+Notice that two instances of Solr have started on two nodes.
+Because we are starting in SolrCloud mode, and did not define any details about an external ZooKeeper cluster, Solr launches its own ZooKeeper and connects both nodes to it.
+
+After startup is complete, you'll be prompted to create a collection to use for indexing data.
+
+[source,subs="verbatim,attributes+"]
+----
+Now let's create a new collection for indexing documents in your 2-node cluster.
+Please provide a name for your new collection: [gettingstarted]
+----
+
+Here's the first place where we'll deviate from the default options.
+This tutorial will ask you to index some sample data included with Solr, called the "techproducts" data.
+Let's name our collection "techproducts" so it's easy to differentiate from other collections we'll create later.
+Enter `techproducts` at the prompt and hit kbd:[enter].
+
+[source,subs="verbatim,attributes+"]
+----
+How many shards would you like to split techproducts into? [2]
+----
+
+This is asking how many xref:solr-glossary.adoc#shard[shards] you want to split your index into across the two nodes.
+Choosing "2" (the default) means we will split the index relatively evenly across both nodes, which is a good way to start.
+Accept the default by hitting kbd:[enter].
+
+[source,subs="verbatim,attributes+"]
+----
+How many replicas per shard would you like to create? [2]
+----
+
+A replica is a copy of the index that's used for failover (see also the xref:solr-glossary.adoc#replica[Solr Glossary definition]).
+Again, the default of "2" is fine to start with here also, so accept the default by hitting kbd:[enter].
+
+[source,subs="verbatim,attributes+"]
+----
+Please choose a configuration for the techproducts collection, available options are:
+_default or sample_techproducts_configs [_default]
+----
+
+We've reached another point where we will deviate from the default option.
+Solr has two sample sets of configuration files (called a configset) available out-of-the-box.
+
+A collection must have a configset, which at a minimum includes the two main configuration files for Solr: the schema file (named either `managed-schema.xml` or `schema.xml`), and `solrconfig.xml`.
+The question here is which configset you would like to start with.
+The `_default` is a bare-bones option, but note there's one whose name includes "techproducts", the same as we named our collection.
+This configset is specifically designed to support the sample data we want to use, so enter `sample_techproducts_configs` at the prompt and hit kbd:[enter].
+
+At this point, Solr will create the collection and again output to the screen the commands it issues.
+
+[source,subs="verbatim,attributes+"]
+----
- Uploading /solr-{solr-docs-version}.0/server/solr/configsets/_default/conf for config techproducts to ZooKeeper at localhost:9983
++Uploading /solr-{solr-full-version}/server/solr/configsets/_default/conf for config techproducts to ZooKeeper at localhost:9983
+
+Connecting to ZooKeeper at localhost:9983 ...
+INFO - 2017-07-27 12:48:59.289; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready
- Uploading /solr-{solr-docs-version}.0/server/solr/configsets/sample_techproducts_configs/conf for config techproducts to ZooKeeper at localhost:9983
++Uploading /solr-{solr-full-version}/server/solr/configsets/sample_techproducts_configs/conf for config techproducts to ZooKeeper at localhost:9983
+
+Creating new collection 'techproducts' using command:
+http://localhost:8983/solr/admin/collections?action=CREATE&name=techproducts&numShards=2&replicationFactor=2&collection.configName=techproducts
+
+{
+ "responseHeader":{
+ "status":0,
+ "QTime":5460},
+ "success":{
+ "192.168.0.110:7574_solr":{
+ "responseHeader":{
+ "status":0,
+ "QTime":4056},
+ "core":"techproducts_shard1_replica_n1"},
+ "192.168.0.110:8983_solr":{
+ "responseHeader":{
+ "status":0,
+ "QTime":4056},
+ "core":"techproducts_shard2_replica_n2"}}}
+
+Enabling auto soft-commits with maxTime 3 secs using the Config API
+
+POSTing request to Config API: http://localhost:8983/solr/techproducts/config
+{"set-property":{"updateHandler.autoSoftCommit.maxTime":"3000"}}
+Successfully set-property updateHandler.autoSoftCommit.maxTime to 3000
+
+SolrCloud example running, please visit: http://localhost:8983/solr
+----
+
+*Congratulations!* Solr is ready for data!
+
+You can see that Solr is running by launching the Solr Admin UI in your web browser: http://localhost:8983/solr/.
+This is the main starting point for administering Solr.
+
+Solr will now be running two "nodes", one on port 7574 and one on port 8983.
+There is one collection created automatically, `techproducts`, a two shard collection, each with two replicas.
+
+The http://localhost:8983/solr/#/~cloud[Cloud tab] in the Admin UI diagrams the collection nicely:
+
+.SolrCloud Diagram
+image::solr-tutorial/tutorial-solrcloud.png[]
+
+== Index the Techproducts Data
+
+Your Solr server is up and running, but it doesn't contain any data yet, so we can't do any queries.
+
+Solr includes the `bin/post` tool in order to facilitate indexing various types of documents easily.
+We'll use this tool for the indexing examples below.
+
+You'll need a command shell to run some of the following examples, rooted in the Solr install directory; the shell from where you launched Solr works just fine.
+
+NOTE: Currently the `bin/post` tool does not have a comparable Windows script, but the underlying Java program invoked is available.
+We'll show examples below for Windows, but you can also see the section xref:indexing-guide:post-tool.adoc#post-tool-windows-support[Post Tool Windows Support].
+
+The data we will index is in the `example/exampledocs` directory.
+The documents are in a mix of document formats (JSON, CSV, etc.), and fortunately we can index them all at once:
+
+.Linux/Mac
+[source,subs="verbatim,attributes+"]
+----
- solr-{solr-docs-version}.0:$ bin/post -c techproducts example/exampledocs/*
++solr-{solr-full-version}:$ bin/post -c techproducts example/exampledocs/*
+----
+
+.Windows
+[source,subs="verbatim,attributes+"]
+----
- C:\solr-{solr-docs-version}.0> java -jar -Dc=techproducts -Dauto example\exampledocs\post.jar example\exampledocs\*
++C:\solr-{solr-full-version}> java -jar -Dc=techproducts -Dauto example\exampledocs\post.jar example\exampledocs\*
+----
+
+You should see output similar to the following:
+
+[source,subs="verbatim,attributes+"]
+----
+SimplePostTool version 5.0.0
+Posting files to [base] url http://localhost:8983/solr/techproducts/update...
+Entering auto mode. File endings considered are xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
+POSTing file books.csv (text/csv) to [base]
+POSTing file books.json (application/json) to [base]/json/docs
+POSTing file gb18030-example.xml (application/xml) to [base]
+POSTing file hd.xml (application/xml) to [base]
+POSTing file ipod_other.xml (application/xml) to [base]
+POSTing file ipod_video.xml (application/xml) to [base]
+POSTing file manufacturers.xml (application/xml) to [base]
+POSTing file mem.xml (application/xml) to [base]
+POSTing file money.xml (application/xml) to [base]
+POSTing file monitor.xml (application/xml) to [base]
+POSTing file monitor2.xml (application/xml) to [base]
+POSTing file more_books.jsonl (application/json) to [base]/json/docs
+POSTing file mp500.xml (application/xml) to [base]
+POSTing file post.jar (application/octet-stream) to [base]/extract
+POSTing file sample.html (text/html) to [base]/extract
+POSTing file sd500.xml (application/xml) to [base]
+POSTing file solr-word.pdf (application/pdf) to [base]/extract
+POSTing file solr.xml (application/xml) to [base]
+POSTing file test_utf8.sh (application/octet-stream) to [base]/extract
+POSTing file utf8-example.xml (application/xml) to [base]
+POSTing file vidcard.xml (application/xml) to [base]
+21 files indexed.
+COMMITting Solr index changes to http://localhost:8983/solr/techproducts/update...
+Time spent: 0:00:00.822
+----
+
+Congratulations again! You have data in your Solr!
+
+Now we're ready to start searching.
+
+== Basic Searching
+
+Solr can be queried via REST clients, curl, wget, Chrome POSTMAN, etc., as well as via native clients available for many programming languages.
+
+The Solr Admin UI includes a query builder interface via the Query tab for the `techproducts` collection (at http://localhost:8983/solr/#/techproducts/query).
+If you click the btn:[Execute Query] button without changing anything in the form, you'll get 10 documents in JSON format:
+
+.Query Screen
+image::solr-tutorial/tutorial-query-screen.png[Solr Quick Start: techproducts Query screen with results]
+
+The URL sent by the Admin UI to Solr is shown in light grey near the top right of the above screenshot.
+If you click on it, your browser will show you the raw response.
+
+To use curl, give the same URL shown in your browser in quotes on the command line:
+
+`curl "http://localhost:8983/solr/techproducts/select?indent=on&q=\*:*"`
+
+What's happening here is that we are using Solr's query parameter (`q`) with a special syntax that requests all documents in the index (`\*:*`).
+All of the documents are not returned to us, however, because of the default for a parameter called `rows`, which you can see in the form is `10`.
+You can change the parameter in the UI or in the defaults if you wish.
+
+Solr has very powerful search options, and this tutorial won't be able to cover all of them.
+But we can cover some of the most common types of queries.
+
+=== Search for a Single Term
+
+To search for a term, enter it as the `q` parameter value in the Solr Admin UI Query screen, replacing `\*:*` with the term you want to find.
+
+Enter "foundation" and hit btn:[Execute Query] again.
+
+If you prefer curl, enter something like this:
+
+`curl "http://localhost:8983/solr/techproducts/select?q=foundation"`
+
+You'll see something like this:
+
+[source,json]
+{
+ "responseHeader":{
+ "zkConnected":true,
+ "status":0,
+ "QTime":8,
+ "params":{
+ "q":"foundation"}},
+ "response":{"numFound":4,"start":0,"maxScore":2.7879646,"docs":[
+ {
+ "id":"0553293354",
+ "cat":["book"],
+ "name":"Foundation",
+ "price":7.99,
+ "price_c":"7.99,USD",
+ "inStock":true,
+ "author":"Isaac Asimov",
+ "author_s":"Isaac Asimov",
+ "series_t":"Foundation Novels",
+ "sequence_i":1,
+ "genre_s":"scifi",
+ "_version_":1574100232473411586,
+ "price_c____l_ns":799}]
+}}
+
+The response indicates that there are 4 hits (`"numFound":4`).
+We've only included one document the above sample output, but since 4 hits is lower than the `rows` parameter default of 10 to be returned, you should see all 4 of them.
+
+Note the `responseHeader` before the documents.
+This header will include the parameters you have set for the search.
+By default it shows only the parameters _you_ have set for this query, which in this case is only your query term.
+
+The documents we got back include all the fields for each document that were indexed.
+This is, again, default behavior.
+If you want to restrict the fields in the response, you can use the `fl` parameter, which takes a comma-separated list of field names.
+This is one of the available fields on the query form in the Admin UI.
+
+Put "id" (without quotes) in the "fl" box and hit btn:[Execute Query] agai
+Or, to specify it with curl:
+
+`curl "http://localhost:8983/solr/techproducts/select?q=foundation&fl=id"`
+
+You should only see the IDs of the matching records returned.
+
+=== Field Searches
+
+All Solr queries look for documents using some field.
+Often you want to query across multiple fields at the same time, and this is what we've done so far with the "foundation" query.
+This is possible with the use of copy fields, which are set up already with this set of configurations.
+We'll cover copy fields a little bit more in xref:tutorial-films.adoc[Exercise 2].
+
+Sometimes, though, you want to limit your query to a single field.
+This can make your queries more efficient and the results more relevant for users.
+
+Much of the data in our small sample data set is related to products.
+Let's say we want to find all the "electronics" products in the index.
+In the Query screen, enter "electronics" (without quotes) in the `q` box and hit btn:[Execute Query].
+You should get 14 results, such as:
+
+[source,json]
+{
+ "responseHeader":{
+ "zkConnected":true,
+ "status":0,
+ "QTime":6,
+ "params":{
+ "q":"electronics"}},
+ "response":{"numFound":14,"start":0,"maxScore":1.5579545,"docs":[
+ {
+ "id":"IW-02",
+ "name":"iPod & iPod Mini USB 2.0 Cable",
+ "manu":"Belkin",
+ "manu_id_s":"belkin",
+ "cat":["electronics",
+ "connector"],
+ "features":["car power adapter for iPod, white"],
+ "weight":2.0,
+ "price":11.5,
+ "price_c":"11.50,USD",
+ "popularity":1,
+ "inStock":false,
+ "store":"37.7752,-122.4232",
+ "manufacturedate_dt":"2006-02-14T23:55:59Z",
+ "_version_":1574100232554151936,
+ "price_c____l_ns":1150}]
+}}
+
+This search finds all documents that contain the term "electronics" anywhere in the indexed fields.
+However, we can see from the above there is a `cat` field (for "category").
+If we limit our search for only documents with the category "electronics", the results will be more precise for our users.
+
+Update your query in the `q` field of the Admin UI so it's `cat:electronics`.
+Now you get 12 results:
+
+[source,json]
+{
+ "responseHeader":{
+ "zkConnected":true,
+ "status":0,
+ "QTime":6,
+ "params":{
+ "q":"cat:electronics"}},
+ "response":{"numFound":12,"start":0,"maxScore":0.9614112,"docs":[
+ {
+ "id":"SP2514N",
+ "name":"Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133",
+ "manu":"Samsung Electronics Co. Ltd.",
+ "manu_id_s":"samsung",
+ "cat":["electronics",
+ "hard drive"],
+ "features":["7200RPM, 8MB cache, IDE Ultra ATA-133",
+ "NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor"],
+ "price":92.0,
+ "price_c":"92.0,USD",
+ "popularity":6,
+ "inStock":true,
+ "manufacturedate_dt":"2006-02-13T15:26:37Z",
+ "store":"35.0752,-97.032",
+ "_version_":1574100232511160320,
+ "price_c____l_ns":9200}]
+ }}
+
+Using curl, this query would look like this:
+
+`curl "http://localhost:8983/solr/techproducts/select?q=cat:electronics"`
+
+=== Phrase Search
+
+To search for a multi-term phrase, enclose it in double quotes: `q="multiple terms here"`.
+For example, search for "CAS latency" by entering that phrase in quotes to the `q` box in the Admin UI.
+
+If you're following along with curl, note that the space between terms must be converted to "+" in a URL, as so:
+
+`curl "http://localhost:8983/solr/techproducts/select?q=\"CAS+latency\""`
+
+We get 2 results:
+
+[source,json]
+{
+ "responseHeader":{
+ "zkConnected":true,
+ "status":0,
+ "QTime":7,
+ "params":{
+ "q":"\"CAS latency\""}},
+ "response":{"numFound":2,"start":0,"maxScore":5.937691,"docs":[
+ {
+ "id":"VDBDB1A16",
+ "name":"A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM",
+ "manu":"A-DATA Technology Inc.",
+ "manu_id_s":"corsair",
+ "cat":["electronics",
+ "memory"],
+ "features":["CAS latency 3, 2.7v"],
+ "popularity":0,
+ "inStock":true,
+ "store":"45.18414,-93.88141",
+ "manufacturedate_dt":"2006-02-13T15:26:37Z",
+ "payloads":"electronics|0.9 memory|0.1",
+ "_version_":1574100232590852096},
+ {
+ "id":"TWINX2048-3200PRO",
+ "name":"CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail",
+ "manu":"Corsair Microsystems Inc.",
+ "manu_id_s":"corsair",
+ "cat":["electronics",
+ "memory"],
+ "features":["CAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader"],
+ "price":185.0,
+ "price_c":"185.00,USD",
+ "popularity":5,
+ "inStock":true,
+ "store":"37.7752,-122.4232",
+ "manufacturedate_dt":"2006-02-13T15:26:37Z",
+ "payloads":"electronics|6.0 memory|3.0",
+ "_version_":1574100232584560640,
+ "price_c____l_ns":18500}]
+ }}
+
+=== Combining Searches
+
+By default, when you search for multiple terms and/or phrases in a single query, Solr will only require that one of them is present in order for a document to match.
+Documents containing more terms will be sorted higher in the results list.
+
+You can require that a term or phrase is present by prefixing it with a `+` (plus); conversely, to disallow the presence of a term or phrase, prefix it with a `-` (minus).
+
+To find documents that contain both terms "electronics" and "music", enter `+electronics +music` in the `q` box in the Admin UI Query tab.
+
+If you're using curl, you must encode the `+` character because it has a reserved purpose in URLs (encoding the space character).
+The encoding for `+` is `%2B` as in:
+
+`curl "http://localhost:8983/solr/techproducts/select?q=%2Belectronics%20%2Bmusic"`
+
+You should only get a single result.
+
+To search for documents that contain the term "electronics" but *don't* contain the term "music", enter `+electronics -music` in the `q` box in the Admin UI.
+For curl, again, URL encode `+` as `%2B` as in:
+
+`curl "http://localhost:8983/solr/techproducts/select?q=%2Belectronics+-music"`
+
+This time you get 13 results.
+
+=== More Information on Searching
+
+We have only scratched the surface of the search options available in Solr.
+For more Solr search options, see xref:query-guide:query-syntax-and-parsers.adoc[].
+
+== Exercise 1 Wrap Up
+
+At this point, you've seen how Solr can index data and have done some basic queries.
+You can choose now to continue to the next example which will introduce more Solr concepts, such as faceting results and managing your schema, or you can strike out on your own.
+
+If you decide not to continue with this tutorial, the data we've indexed so far is likely of little value to you.
+You can delete your installation and start over, or you can use the `bin/solr` script we started out with to delete this collection:
+
+`bin/solr delete -c techproducts`
+
+And then create a new collection:
+
+`bin/solr create -c <yourCollection> -s 2 -rf 2`
+
+To stop both of the Solr nodes we started, issue the command:
+
+`bin/solr stop -all`
+
+For more information on start/stop and collection options with `bin/solr`, see xref:deployment-guide:solr-control-script-reference.adoc[].
diff --cc solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc
index eb69e3c,0000000..bd5dcb6
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc
+++ b/solr/solr-ref-guide/modules/indexing-guide/pages/partial-document-updates.adoc
@@@ -1,545 -1,0 +1,545 @@@
+= Partial Document Updates
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+Once you have indexed the content you need in your Solr index, you will want to start thinking about your strategy for dealing with changes to those documents.
+Solr supports three approaches to updating documents that have only partially changed.
+
+The first is _<<Atomic Updates,atomic updates>>_.
+This approach allows changing only one or more fields of a document without having to reindex the entire document.
+
+The second approach is known as _<<In-Place Updates,in-place updates>>_.
+This approach is similar to atomic updates (is a subset of atomic updates in some sense), but can be used only for updating single valued non-indexed and non-stored docValue-based numeric fields.
+
+The third approach is known as _<<Optimistic Concurrency,optimistic concurrency>>_ or _optimistic locking_.
+It is a feature of many NoSQL databases, and allows conditional updating a document based on its version.
+This approach includes semantics and rules for how to deal with version matches or mis-matches.
+
+Atomic Updates (and in-place updates) and Optimistic Concurrency may be used as independent strategies for managing changes to documents, or they may be combined: you can use optimistic concurrency to conditionally apply an atomic update.
+
+== Atomic Updates
+
+Solr supports several modifiers that atomically update values of a document.
+This allows updating only specific fields, which can help speed indexing processes in an environment where speed of index additions is critical to the application.
+
+To use atomic updates, add a modifier to the field that needs to be updated.
+The content can be updated, added to, or, if the field has a numeric type, incrementally increased or decreased.
+
+`set`::
+Set or replace the field value(s) with the specified value(s), or remove the values if 'null' or empty list is specified as the new value.
++
+May be specified as a single value, or as a list for multiValued fields.
+
+`add`::
+Adds the specified values to a multiValued field.
+May be specified as a single value, or as a list.
+
+`add-distinct`::
+Adds the specified values to a multiValued field, only if not already present.
+May be specified as a single value, or as a list.
+
+`remove`::
+Removes (all occurrences of) the specified values from a multiValued field.
+May be specified as a single value, or as a list.
+
+`removeregex`::
+Removes all occurrences of the specified regex from a multiValued field.
+May be specified as a single value, or as a list.
+
+`inc`::
+Increments or decrements a numeric field's value by a specific amount, specified as a single integer or float.
+Postive amounts increment the field's value, and negative decrement.
+
+=== Field Storage
+
+The core functionality of atomically updating a document requires that all fields in your schema must be configured as stored (`stored="true"`) or docValues (`docValues="true"`) except for fields which are `<copyField/>` destinations, which must be configured as `stored="false"`.
+Atomic updates are applied to the document represented by the existing stored field values.
+All data in copyField destinations fields must originate from ONLY copyField sources.
+
+If `<copyField/>` destinations are configured as stored, then Solr will attempt to index both the current value of the field as well as an additional copy from any source fields.
+If such fields contain some information that comes from the indexing program and some information that comes from copyField, then the information which originally came from the indexing program will be lost when an atomic update is made.
+
+There are other kinds of derived fields that must also be set so they aren't stored.
+Some spatial field types, such as BBoxField and LatLonSpatialFieldType, use derived fields.
+CurrencyFieldType also uses derived fields.
+These types create additional fields which are normally specified by a dynamic field definition.
+That dynamic field definition must be not stored, or indexing will fail.
+
+=== Example Updating Part of a Document
+
+If the following document exists in our collection:
+
+[source,json]
+----
+{"id":"mydoc",
+ "price":10,
+ "popularity":42,
+ "categories":["kids"],
+ "sub_categories":["under_5","under_10"],
+ "promo_ids":["a123x"],
+ "tags":["free_to_try","buy_now","clearance","on_sale"]
+}
+----
+
+And we apply the following update command:
+
+[source,json]
+----
+{"id":"mydoc",
+ "price":{"set":99},
+ "popularity":{"inc":-7},
+ "categories":{"add":["toys","games"]},
+ "sub_categories":{"add-distinct":"under_10"},
+ "promo_ids":{"remove":"a123x"},
+ "tags":{"remove":["free_to_try","on_sale"]}
+}
+----
+
+The resulting document in our collection will be:
+
+[source,json]
+----
+{"id":"mydoc",
+ "price":99,
+ "popularity":35,
+ "categories":["kids","toys","games"],
+ "sub_categories":["under_5","under_10"],
+ "tags":["buy_now","clearance"]
+}
+----
+
+=== Updating Child Documents
+
+Solr supports modifying, adding and removing child documents as part of atomic updates.
+Syntactically, updates changing the children of a document are very similar to regular atomic updates of simple fields, as demonstrated by the examples below.
+
+Schema and configuration requirements for updating child documents use the same
+<<Field Storage>> requirements for atomic updates mentioned above.
+
+Under the hood, Solr conceptually behaves similarly for nested documents as for non-nested documents, it's just that it applies to entire trees (from the root) of nested documents instead of stand-alone documents.
+You can expect more overhead because of this.
+In-place updates avoid that.
+
+[IMPORTANT]
+====
+.Routing Updates using child document Ids in SolrCloud
+
+When SolrCloud receives document updates, the
+xref:deployment-guide:solrcloud-shards-indexing.adoc#document-routing[document routing] rules for the collection is used to determine which shard should process the update based on the `id` of the document.
+
+When sending an update that specifies the `id` of a _child document_ this will not work by default: the correct shard to send the document to is based on the `id` of the "Root" document for the block the child document is in, *not* the `id` of the child document being updated.
+
+Solr offers two solutions to address this:
+
+* Clients may specify a xref:deployment-guide:solrcloud-shards-indexing.adoc#document-routing[`\_route_` parameter], with the `id` of the Root document as the parameter value, on each update to tell Solr which shard should process the update.
+* Clients can use the (default) `compositeId` router's "prefix routing" feature when indexing all documents to ensure that all child/descendent documents in a Block use the same `id` prefix as the Root level document.
+This will cause Solr's default routing logic to automatically send child document updates to the correct shard.
+
+Furthermore, you _should_ (sometimes _must_) specify the Root document's ID in the `\_root_`
+field of this partial update.
+This is how Solr understands that you are updating a child
+document, and not a Root document.
+Without it, Solr only guesses that the `\_route_` parameter is
+equivalent, but it may be absent or not equivalent (e.g., when using the `implicit` router).
+
+All of the examples below use `id` prefixes, so no `\_route_` parameter will be necessary for these examples.
+====
+
+For the upcoming examples, we'll assume an index containing the same documents covered in xref:indexing-nested-documents.adoc#example-indexing-syntax[Indexing Nested Documents]:
+
+include::indexing-nested-documents.adoc[tag=sample-indexing-deeply-nested-documents]
+
+==== Modifying Child Document Fields
+
+All of the <<atomic-updates,Atomic Update operations>> mentioned above are supported for "real" fields of Child Documents:
+
+[source,bash]
+----
+curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[
+{
+ "id": "P11!S31",
+ "_root_": "P11!prod",
+ "price_i": { "inc": 73 },
+ "color_s": { "set": "GREY" }
+} ]'
+----
+
+==== Replacing All Child Documents
+
+As with normal (multiValued) fields, the `set` keyword can be used to replace all child documents in a pseudo-field:
+
+[source,bash]
+----
+curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[
+{
+ "id": "P22!S22",
+ "_root_": "P22!prod",
+ "manuals": { "set": [ { "id": "P22!D77",
+ "name_s": "Why Red Pens Are the Best",
+ "content_t": "... correcting papers ...",
+ },
+ { "id": "P22!D88",
+ "name_s": "How to get Red ink stains out of fabric",
+ "content_t": "... vinegar ...",
+ } ] }
+
+} ]'
+----
+
+==== Adding a Child Document
+
+As with normal (multiValued) fields, the `add` keyword can be used to add additional child documents to a pseudo-field:
+
+[source,bash]
+----
+curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[
+{
+ "id": "P11!S21",
+ "_root_": "P11!prod",
+ "manuals": { "add": { "id": "P11!D99",
+ "name_s": "Why Red Staplers Are the Best",
+ "content_t": "Once upon a time, Mike Judge ...",
+ } }
+} ]'
+----
+
+Note that this is add-or-replace (by ID). Meaning, if it happens that doc `P11!S21` already has a child doc with the ID `P11!D99` (the one we are adding), then it will be replaced.
+
+==== Removing a Child Document
+
+As with normal (multiValued) fields, the `remove` keyword can be used to remove a child document (by `id`) from it's pseudo-field:
+
+[source,bash]
+----
+curl -X POST 'http://localhost:8983/solr/gettingstarted/update?commit=true' -H 'Content-Type: application/json' --data-binary '[
+{
+ "id": "P11!S21",
+ "_root_": "P11!prod",
+ "manuals": { "remove": { "id": "P11!D41" } }
+} ]'
+----
+
+
+== In-Place Updates
+
+In-place updates are very similar to atomic updates; in some sense, this is a subset of atomic updates.
+In regular atomic updates, the entire document is reindexed internally during the application of the update.
+However, in this approach, only the fields to be updated are affected and the rest of the documents are not reindexed internally.
+Hence, the efficiency of updating in-place is unaffected by the size of the documents that are updated (i.e., number of fields, size of fields, etc.).
+Apart from these internal differences in efficiency, there is no functional difference between atomic updates and in-place updates.
+
+An atomic update operation is performed using this In-Place approach only when the fields to be updated meet these three conditions:
+
+* are non-indexed (`indexed="false"`), non-stored (`stored="false"`), single valued (`multiValued="false"`) numeric docValues (`docValues="true"`) fields;
+* the `\_version_` field is also a non-indexed, non-stored single valued docValues field; and,
+* copy targets of updated fields, if any, are also non-indexed, non-stored single valued numeric docValues fields.
+
+To use in-place updates, add a modifier to the field that needs to be updated.
+The content can be updated or incremented/decremented.
+
+`set`::
+Set or replace the field value(s) with the specified value(s).
+May be specified as a single value.
+
+`inc`::
+Increments or decrements a numeric field's value by a specific amount, specified as a single integer or float.
+Postive amounts increment the field's value, and negative decrement.
+
+[TIP]
+====
+.Preventing Atomic Updates That Can't be Done In-Place
+
+Since it can be tricky to ensure that all of the necessary conditions are satisfied to ensure that an update can be done In-Place, Solr supports a request parameter option named `update.partial.requireInPlace`.
+When set to `true`, an atomic update that can not be done In-Place will fail.
+Users can specify this option when they would prefer that an update request "fail fast" if it can't be done In-Place.
+====
+
+=== In-Place Update Example
+
+If the price and popularity fields are defined in the schema as:
+
+`<field name="price" type="float" indexed="false" stored="false" docValues="true"/>`
+
+`<field name="popularity" type="float" indexed="false" stored="false" docValues="true"/>`
+
+If the following document exists in our collection:
+
+[source,json]
+----
+{
+ "id":"mydoc",
+ "price":10,
+ "popularity":42,
+ "categories":["kids"],
+ "promo_ids":["a123x"],
+ "tags":["free_to_try","buy_now","clearance","on_sale"]
+}
+----
+
+And we apply the following update command:
+
+[source,json]
+----
+{
+ "id":"mydoc",
+ "price":{"set":99},
+ "popularity":{"inc":20}
+}
+----
+
+The resulting document in our collection will be:
+
+[source,json]
+----
+{
+ "id":"mydoc",
+ "price":99,
+ "popularity":62,
+ "categories":["kids"],
+ "promo_ids":["a123x"],
+ "tags":["free_to_try","buy_now","clearance","on_sale"]
+}
+----
+
+== Optimistic Concurrency
+
+Optimistic Concurrency is a feature of Solr that can be used by client applications which update/replace documents to ensure that the document they are replacing/updating has not been concurrently modified by another client application.
+This feature works by requiring a `\_version_` field on all documents in the index, and comparing that to a `\_version_` specified as part of the update command.
+By default, Solr's Schema includes a `\_version_` field, and this field is automatically added to each new document.
+
+In general, using optimistic concurrency involves the following work flow:
+
+. A client reads a document.
+In Solr, one might retrieve the document with the `/get` handler to be sure to have the latest version.
+. A client changes the document locally.
+. The client resubmits the changed document to Solr, for example, perhaps with the `/update` handler.
+. If there is a version conflict (HTTP error code 409), the client starts the process over.
+
+When the client resubmits a changed document to Solr, the `\_version_` can be included with the update to invoke optimistic concurrency control.
+Specific semantics are used to define when the document should be updated or when to report a conflict.
+
+* If the content in the `\_version_` field is greater than '1' (i.e., '12345'), then the `\_version_` in the document must match the `\_version_` in the index.
+* If the content in the `\_version_` field is equal to '1', then the document must simply exist.
+In this case, no version matching occurs, but if the document does not exist, the updates will be rejected.
+* If the content in the `\_version_` field is less than '0' (i.e., '-1'), then the document must *not* exist.
+In this case, no version matching occurs, but if the document exists, the updates will be rejected.
+* If the content in the `\_version_` field is equal to '0', then it doesn't matter if the versions match or if the document exists or not.
+If it exists, it will be overwritten; if it does not exist, it will be added.
+
+When documents are added/updated in batches even a single version conflict may lead to rejecting the entire batch.
+Use the parameter `failOnVersionConflicts=false` to avoid failure of the entire batch when version constraints fail for one or more documents in a batch.
+
+If the document being updated does not include the `\_version_` field, and atomic updates are not being used, the document will be treated by normal Solr rules, which is usually to discard the previous version.
+
+When using Optimistic Concurrency, clients can include an optional `versions=true` request parameter to indicate that the _new_ versions of the documents being added should be included in the response.
+This allows clients to immediately know what the `\_version_` is of every document added without needing to make a redundant xref:configuration-guide:realtime-get.adoc[`/get` request].
+
+Following are some examples using `versions=true` in queries:
+
+[source,bash]
+----
+$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?versions=true&omitHeader=true' --data-binary '
+[ { "id" : "aaa" },
+ { "id" : "bbb" } ]'
+----
+[source,json]
+----
+{
+ "adds":[
+ "aaa",1632740120218042368,
+ "bbb",1632740120250548224]}
+----
+
+In this example, we have added 2 documents "aaa" and "bbb".
+Because we added `versions=true` to the request, the response shows the document version for each document.
+
+[source,bash]
+----
+$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?_version_=999999&versions=true&omitHeader=true' --data-binary '
+ [{ "id" : "aaa",
+ "foo_s" : "update attempt with wrong existing version" }]'
+----
+[source,json]
+----
+{
+ "error":{
+ "metadata":[
+ "error-class","org.apache.solr.common.SolrException",
+ "root-error-class","org.apache.solr.common.SolrException"],
+ "msg":"version conflict for aaa expected=999999 actual=1632740120218042368",
+ "code":409}}
+----
+
+
+In this example, we've attempted to update document "aaa" but specified the wrong version in the request: `_version_=999999` doesn't match the document version we just got when we added the document.
+We get an error in response.
+
+[source,bash]
+----
+$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?_version_=1632740120218042368&versions=true&commit=true&omitHeader=true' --data-binary '
+[{ "id" : "aaa",
+ "foo_s" : "update attempt with correct existing version" }]'
+----
+[source,json]
+----
+{
+ "adds":[
+ "aaa",1632740462042284032]}
+----
+
+Now we've sent an update with a value for `\_version_` that matches the value in the index, and it succeeds.
+Because we included `versions=true` to the update request, the response includes a different value for the `\_version_` field.
+[source,bash]
+----
+$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?&versions=true&commit=true&omitHeader=true' --data-binary '
+[{ "id" : "aaa", _version_ : 100,
+ "foo_s" : "update attempt with wrong existing version embedded in document" }]'
+----
+[source,json]
+----
+{
+ "error":{
+ "metadata":[
+ "error-class","org.apache.solr.common.SolrException",
+ "root-error-class","org.apache.solr.common.SolrException"],
+ "msg":"version conflict for aaa expected=100 actual=1632740462042284032",
+ "code":409}}
+----
+
+Now we've sent an update with a value for `\_version_` embedded in the document itself.
+This request fails because we have specified the wrong version.
+This is useful when documents are sent in a batch and different `\_version_` values need to be specified for each doc.
+
+[source,bash]
+----
+$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?&versions=true&commit=true&omitHeader=true' --data-binary '
+[{ "id" : "aaa", _version_ : 1632740462042284032,
+ "foo_s" : "update attempt with correct version embedded in document" }]'
+----
+[source,json]
+----
+{
+ "adds":[
+ "aaa",1632741942747987968]}
+----
+
+Now we've sent an update with a value for `\_version_` embedded in the document itself.
+This request fails because we have specified the wrong version.
+This is useful when documents are sent in a batch and different `\_version_` values need to be specified for each doc.
+
+
+[source,bash]
+----
+$ curl 'http://localhost:8983/solr/techproducts/query?q=*:*&fl=id,_version_&omitHeader=true'
+----
+
+[source,json]
+----
+{
+ "response":{"numFound":3,"start":0,"docs":[
+ { "_version_":1632740120250548224,
+ "id":"bbb"},
+ { "_version_":1632741942747987968,
+ "id":"aaa"}]
+ }}
+
+----
+
+Finally, we can issue a query that requests the `\_version_` field be included in the response, and we can see that for the two documents in our example index.
+
+[source,bash]
+----
+$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/techproducts/update?versions=true&_version_=-1&failOnVersionConflicts=false&omitHeader=true' --data-binary '
+[ { "id" : "aaa" },
+ { "id" : "ccc" } ]'
+----
+[source,json]
+----
+{
+ "adds":[
+ "ccc",1632740949182382080]}
+----
+
+In this example, we have added 2 documents "aaa" and "ccc".
+As we have specified the parameter `\_version_=-1`, this request should not add the document with the id `aaa` because it already exists.
+The request succeeds & does not throw any error because the `failOnVersionConflicts=false` parameter is specified.
+The response shows that only document `ccc` is added and `aaa` is silently ignored.
+
+
+For more information, please also see Yonik Seeley's presentation on https://www.youtube.com/watch?v=WYVM6Wz-XTw[NoSQL features in Solr 4] from Apache Lucene EuroCon 2012.
+
+== Document Centric Versioning Constraints
+
+Optimistic Concurrency is extremely powerful, and works very efficiently because it uses an internally assigned, globally unique values for the `\_version_` field.
+However, in some situations users may want to configure their own document specific version field, where the version values are assigned on a per-document basis by an external system, and have Solr reject updates that attempt to replace a document with an "older" version.
+In situations like this the {solr-javadocs}/core/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.html[`DocBasedVersionConstraintsProcessorFactory`] can be useful.
+
+The basic usage of `DocBasedVersionConstraintsProcessorFactory` is to configure it in `solrconfig.xml` as part of the xref:configuration-guide:update-request-processors.adoc#update-request-processor-configuration[UpdateRequestProcessorChain] and specify the name of your custom `versionField` in your schema that should be checked when validating updates:
+
+[source,xml]
+----
+<processor class="solr.DocBasedVersionConstraintsProcessorFactory">
+ <str name="versionField">my_version_l</str>
+</processor>
+----
+
+Note that `versionField` is a comma-delimited list of fields to check for version numbers.
+Once configured, this update processor will reject (HTTP error code 409) any attempt to update an existing document where the value of the `my_version_l` field in the "new" document is not greater then the value of that field in the existing document.
+
+.versionField vs `\_version_`
+[IMPORTANT]
+====
+The `\_version_` field used by Solr for its normal optimistic concurrency also has important semantics in how updates are distributed to replicas in SolrCloud, and *MUST* be assigned internally by Solr.
+Users can not re-purpose that field and specify it as the `versionField` for use in the `DocBasedVersionConstraintsProcessorFactory` configuration.
+====
+
+`DocBasedVersionConstraintsProcessorFactory` supports the following additional configuration parameters, which are all optional:
+
+`ignoreOldUpdates`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `false`
+|===
++
+If set to `true`, the update will be silently ignored (and return a status 200 to the client) instead of rejecting updates where the `versionField` is too low.
+
+`deleteVersionParam`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: none
+|===
++
+A String parameter that can be specified to indicate that this processor should also inspect Delete By Id commands.
++
+The value of this option should be the name of a request parameter that the processor will consider mandatory for all attempts to Delete By Id, and must be be used by clients to specify a value for the `versionField` which is greater then the existing value of the document to be deleted.
++
+When using this request parameter, any Delete By Id command with a high enough document version number to succeed will be internally converted into an Add Document command that replaces the existing document with a new one which is empty except for the Unique Key and `versionField` to keeping a record of the deleted version so future Add Document commands will fail if their "new" version is not high enough.
++
+If `versionField` is specified as a list, then this parameter too must be specified as a comma-delimited list of the same size so that the parameters correspond with the fields.
+
+`supportMissingVersionOnOldDocs`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: `false`
+|===
++
+If set to `true`, allows any document written *before* this feature is enabled and are missing the `versionField`, to be overwritten.
+
- Please consult the {solr-javadocs}/core/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.html[DocBasedVersionConstraintsProcessorFactory javadocs] and https://github.com/apache/lucene-solr/blob/master/solr/core/src/test-files/solr/collection1/conf/solrconfig-externalversionconstraint.xml[test solrconfig.xml file] for additional information and example usages.
++Please consult the {solr-javadocs}/core/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.html[DocBasedVersionConstraintsProcessorFactory javadocs] and https://github.com/apache/solr/blob/releases/solr/{solr-full-version}/solr/core/src/test-files/solr/collection1/conf/solrconfig-externalversionconstraint.xml[test solrconfig.xml file] for additional information and example usages.
diff --cc solr/solr-ref-guide/modules/query-guide/pages/jdbc-zeppelin.adoc
index 5299f0f,0000000..a025637
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/query-guide/pages/jdbc-zeppelin.adoc
+++ b/solr/solr-ref-guide/modules/query-guide/pages/jdbc-zeppelin.adoc
@@@ -1,91 -1,0 +1,91 @@@
+= JDBC with Apache Zeppelin
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+The Solr JDBC driver can support http://zeppelin.apache.org/[Apache Zeppelin].
+
+[NOTE]
+====
+A Solr-specific interpreter is available as an alternative to using the JDBC driver.
+See the section xref:math-start.adoc#zeppelin-solr-interpreter[Zeppelin-Solr Interpreter] for details.
+
+If you choose to use Zeppelin's JDBC interpreter instead, you must use Zeppelin 0.6.0 or greater to get JDBC support.
+====
+
+To use Apache Zeppelin with Solr, you will need to create a JDBC interpreter for Solr.
+This will add SolrJ to the interpreter classpath.
+Once the interpreter has been created, you can create a notebook to issue queries.
+The http://zeppelin.apache.org/docs/latest/interpreter/jdbc.html[Zeppelin JDBC interpreter documentation] provides additional information about JDBC prefixes and other features.
+
+== Create the Apache Solr JDBC Interpreter
+
+.Click "Interpreter" in the top navigation
+image::jdbc-zeppelin/zeppelin_solrjdbc_1.png[image,height=400]
+
+.Click "Create"
+image::jdbc-zeppelin/zeppelin_solrjdbc_2.png[image,height=400]
+
+.Enter information about your Solr installation
+image::jdbc-zeppelin/zeppelin_solrjdbc_3.png[image,height=400]
+
+[NOTE]
+====
+For most installations, Apache Zeppelin configures PostgreSQL as the JDBC interpreter default driver.
+The default driver can either be replaced by the Solr driver as outlined above or you can add a separate JDBC interpreter prefix as outlined in the http://zeppelin.apache.org/docs/latest/interpreter/jdbc.html[Apache Zeppelin JDBC interpreter documentation].
+====
+
+== Create a Notebook
+
+.Click Notebook -> Create new note
+image::jdbc-zeppelin/zeppelin_solrjdbc_4.png[image,width=517,height=400]
+
+.Provide a name and click "Create Note"
+image::jdbc-zeppelin/zeppelin_solrjdbc_5.png[image,width=839,height=400]
+
+== JDBC Interpreter Copy Sheet
+
+To facilitate easy copying the parameters mentioned in the screenshots, here is a consolidated list of the parameters:
+
+[source,text,subs=attributes]
+----
+Name : Solr
+Interpreter : jdbc
+default.url : jdbc:solr://SOLR_ZK_CONNECTION_STRING?collection=<collection_name>
+default.driver : org.apache.solr.client.solrj.io.sql.DriverImpl
+default.user : solr
- dependency : org.apache.solr:solr-solrj:{solr-docs-version}.0
++dependency : org.apache.solr:solr-solrj:{solr-full-version}
+----
+
+== Query with the Notebook
+
+[IMPORTANT]
+====
+For some notebooks, the JDBC interpreter will not be bound to the notebook by default.
+Instructions on how to bind the JDBC interpreter to a notebook are available https://zeppelin.apache.org/docs/latest/interpreter/jdbc.html#bind-to-notebook[here].
+====
+
+.Results of Solr query
+image::jdbc-zeppelin/zeppelin_solrjdbc_6.png[image,width=481,height=400]
+
+The below code block assumes that the Apache Solr driver is setup as the default JDBC interpreter driver.
+If that is not the case, instructions for using a different prefix is available https://zeppelin.apache.org/docs/latest/interpreter/jdbc.html#how-to-use[here].
+
+[source,text]
+----
+%jdbc
+select fielda, fieldb, from test limit 10
+----
diff --cc solr/solr-ref-guide/modules/query-guide/pages/learning-to-rank.adoc
index fbaaa14,0000000..f842037
mode 100644,000000..100644
--- a/solr/solr-ref-guide/modules/query-guide/pages/learning-to-rank.adoc
+++ b/solr/solr-ref-guide/modules/query-guide/pages/learning-to-rank.adoc
@@@ -1,900 -1,0 +1,900 @@@
+= Learning To Rank
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+With the *Learning To Rank* (or *LTR* for short) module you can configure and run machine learned ranking models in Solr.
+
+The module also supports feature extraction inside Solr.
+The only thing you need to do outside Solr is train your own ranking model.
+
+== Learning to Rank Concepts
+
+=== Re-Ranking
+
+Re-Ranking allows you to run a simple query for matching documents and then re-rank the top N documents using the scores from a different, more complex query.
+This page describes the use of *LTR* complex queries, information on other rank queries included in the Solr distribution can be found in xref:query-re-ranking.adoc[].
+
+=== Learning To Rank Models
+
+In information retrieval systems, https://en.wikipedia.org/wiki/Learning_to_rank[Learning to Rank] is used to re-rank the top N retrieved documents using trained machine learning models.
+The hope is that such sophisticated models can make more nuanced ranking decisions than standard ranking functions like https://en.wikipedia.org/wiki/Tf%E2%80%93idf[TF-IDF] or https://en.wikipedia.org/wiki/Okapi_BM25[BM25].
+
+==== Ranking Model
+
+A ranking model computes the scores used to rerank documents.
+Irrespective of any particular algorithm or implementation, a ranking model's computation can use three types of inputs:
+
+* parameters that represent the scoring algorithm
+* features that represent the document being scored
+* features that represent the query for which the document is being scored
+
+==== Interleaving
+
+Interleaving is an approach to Online Search Quality evaluation that allows to compare two models interleaving their results in the final ranked list returned to the user.
+
+* currently only the Team Draft Interleaving algorithm is supported (and its implementation assumes all results are from the same shard)
+
+
+==== Feature
+
+A feature is a value, a number, that represents some quantity or quality of the document being scored or of the query for which documents are being scored.
+For example documents often have a 'recency' quality and 'number of past purchases' might be a quantity that is passed to Solr as part of the search query.
+
+==== Normalizer
+
+Some ranking models expect features on a particular scale.
+A normalizer can be used to translate arbitrary feature values into normalized values e.g., on a 0..1 or 0..100 scale.
+
+=== Training Models
+
+==== Feature Engineering
+
+The LTR module includes several feature classes as well as support for custom features.
+Each feature class's javadocs contain an example to illustrate use of that class.
+The process of https://en.wikipedia.org/wiki/Feature_engineering[feature engineering] itself is then entirely up to your domain expertise and creativity.
+
+[cols=",,,",options="header",]
+|===
+|Feature |Class |Example parameters |<<External Feature Information>>
+|field length |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/FieldLengthFeature.html[FieldLengthFeature] |`{"field":"title"}` |not (yet) supported
+|field value |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/FieldValueFeature.html[FieldValueFeature] |`{"field":"hits"}` |not (yet) supported
+|original score |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/OriginalScoreFeature.html[OriginalScoreFeature] |`{}` |not applicable
+|solr query |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/SolrFeature.html[SolrFeature] |`{"q":"{!func}` `recip(ms(NOW,last_modified)` `,3.16e-11,1,1)"}` |supported
+|solr filter query |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/SolrFeature.html[SolrFeature] |`{"fq":["{!terms f=category}book"]}` |supported
+|solr query + filter query |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/SolrFeature.html[SolrFeature] |`{"q":"{!func}` `recip(ms(NOW,last_modified),` `3.16e-11,1,1)",` `"fq":["{!terms f=category}book"]}` |supported
+|value |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/ValueFeature.html[ValueFeature] |`{"value":"$\{userFromMobile}","required":true}` |supported
+|(custom) |(custom class extending {solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/Feature.html[Feature]) | |
+|===
+
+[cols=",,",options="header",]
+|===
+|Normalizer |Class |Example parameters
+|Identity |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/norm/IdentityNormalizer.html[IdentityNormalizer] |`{}`
+|MinMax |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/norm/MinMaxNormalizer.html[MinMaxNormalizer] |`{"min":"0", "max":"50" }`
+|Standard |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/norm/StandardNormalizer.html[StandardNormalizer] |`{"avg":"42","std":"6"}`
+|(custom) |(custom class extending {solr-javadocs}/modules/ltr/org/apache/solr/ltr/norm/Normalizer.html[Normalizer]) |
+|===
+
+==== Feature Extraction
+
+The ltr module includes a xref:document-transformers.adoc[`[features\]` transformer] to support the calculation and return of feature values for https://en.wikipedia.org/wiki/Feature_extraction[feature extraction] purposes including and especially when you do not yet have an actual reranking model.
+
+==== Feature Selection and Model Training
+
+Feature selection and model training take place offline and outside Solr.
+The ltr module supports two generalized forms of models as well as custom models.
+Each model class's javadocs contain an example to illustrate configuration of that class.
+In the form of JSON files your trained model or models (e.g., different models for different customer geographies) can then be directly uploaded into Solr using provided REST APIs.
+
+[cols=",,",options="header",]
+|===
+|General form |Class |Specific examples
+|Linear |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/LinearModel.html[LinearModel] |RankSVM, Pranking
+|Multiple Additive Trees |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/MultipleAdditiveTreesModel.html[MultipleAdditiveTreesModel] |LambdaMART, Gradient Boosted Regression Trees (GBRT)
+|Neural Network |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/NeuralNetworkModel.html[NeuralNetworkModel] |RankNet
+|(wrapper) |{solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/DefaultWrapperModel.html[DefaultWrapperModel] |(not applicable)
+|(custom) |(custom class extending {solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/AdapterModel.html[AdapterModel]) |(not applicable)
+|(custom) |(custom class extending {solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/LTRScoringModel.html[LTRScoringModel]) |(not applicable)
+|===
+
+== Quick Start with LTR
+
+The `"techproducts"` example included with Solr is pre-configured with the plugins required for learning-to-rank, but they are disabled by default.
+
+To enable the plugins, please specify the `solr.ltr.enabled` JVM System Property when running the example:
+
+[source,bash]
+----
+bin/solr start -e techproducts -Dsolr.ltr.enabled=true
+----
+
+=== Uploading Features
+
+To upload features in a `/path/myFeatures.json` file, please run:
+
+[source,bash]
+----
+curl -XPUT 'http://localhost:8983/solr/techproducts/schema/feature-store' --data-binary "@/path/myFeatures.json" -H 'Content-type:application/json'
+----
+
+To view the features you just uploaded please open the following URL in a browser:
+
+[source,text]
+http://localhost:8983/solr/techproducts/schema/feature-store/_DEFAULT_
+
+.Example: /path/myFeatures.json
+[source,json]
+----
+[
+ {
+ "name" : "documentRecency",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : {
+ "q" : "{!func}recip( ms(NOW,last_modified), 3.16e-11, 1, 1)"
+ }
+ },
+ {
+ "name" : "isBook",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : {
+ "fq": ["{!terms f=cat}book"]
+ }
+ },
+ {
+ "name" : "originalScore",
+ "class" : "org.apache.solr.ltr.feature.OriginalScoreFeature",
+ "params" : {}
+ }
+]
+----
+
+=== Extracting Features
+
+To extract features as part of a query, add `[features]` to the `fl` parameter, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&fl=id,score,[features]
+
+The output will include feature values as a comma-separated list, resembling the output shown here:
+
+[source,json]
+----
+{
+ "responseHeader":{
+ "status":0,
+ "QTime":0,
+ "params":{
+ "q":"test",
+ "fl":"id,score,[features]"}},
+ "response":{"numFound":2,"start":0,"maxScore":1.959392,"docs":[
+ {
+ "id":"GB18030TEST",
+ "score":1.959392,
+ "[features]":"documentRecency=0.020893794,isBook=0.0,originalScore=1.959392"},
+ {
+ "id":"UTF8TEST",
+ "score":1.5513437,
+ "[features]":"documentRecency=0.020893794,isBook=0.0,originalScore=1.5513437"}]
+ }}
+----
+
+=== Uploading a Model
+
+To upload the model in a `/path/myModel.json` file, please run:
+
+[source,bash]
+----
+curl -XPUT 'http://localhost:8983/solr/techproducts/schema/model-store' --data-binary "@/path/myModel.json" -H 'Content-type:application/json'
+----
+
+To view the model you just uploaded please open the following URL in a browser:
+
+[source,text]
+http://localhost:8983/solr/techproducts/schema/model-store
+
+.Example: /path/myModel.json
+[source,json]
+----
+{
+ "class" : "org.apache.solr.ltr.model.LinearModel",
+ "name" : "myModel",
+ "features" : [
+ { "name" : "documentRecency" },
+ { "name" : "isBook" },
+ { "name" : "originalScore" }
+ ],
+ "params" : {
+ "weights" : {
+ "documentRecency" : 1.0,
+ "isBook" : 0.1,
+ "originalScore" : 0.5
+ }
+ }
+}
+----
+
+=== Running a Rerank Query
+
+To rerank the results of a query, add the `rq` parameter to your search, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myModel reRankDocs=100}&fl=id,score
+
+The addition of the `rq` parameter will not change the output of the search.
+
+To obtain the feature values computed during reranking, add `[features]` to the `fl` parameter, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myModel reRankDocs=100}&fl=id,score,[features]
+
+The output will include feature values as a comma-separated list, resembling the output shown here:
+
+[source,json]
+----
+{
+ "responseHeader":{
+ "status":0,
+ "QTime":0,
+ "params":{
+ "q":"test",
+ "fl":"id,score,[features]",
+ "rq":"{!ltr model=myModel reRankDocs=100}"}},
+ "response":{"numFound":2,"start":0,"maxScore":1.0005897,"docs":[
+ {
+ "id":"GB18030TEST",
+ "score":1.0005897,
+ "[features]":"documentRecency=0.020893792,isBook=0.0,originalScore=1.959392"},
+ {
+ "id":"UTF8TEST",
+ "score":0.79656565,
+ "[features]":"documentRecency=0.020893792,isBook=0.0,originalScore=1.5513437"}]
+ }}
+----
+
+=== Running a Rerank Query Interleaving Two Models
+
+To rerank the results of a query, interleaving two models (myModelA, myModelB) add the `rq` parameter to your search, passing two models in input, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myModelA model=myModelB reRankDocs=100}&fl=id,score
+
+To obtain the model that interleaving picked for a search result, computed during reranking, add `[interleaving]` to the `fl` parameter, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myModelA model=myModelB reRankDocs=100}&fl=id,score,[interleaving]
+
+The output will include the model picked for each search result, resembling the output shown here:
+
+[source,json]
+----
+{
+ "responseHeader":{
+ "status":0,
+ "QTime":0,
+ "params":{
+ "q":"test",
+ "fl":"id,score,[interleaving]",
+ "rq":"{!ltr model=myModelA model=myModelB reRankDocs=100}"}},
+ "response":{"numFound":2,"start":0,"maxScore":1.0005897,"docs":[
+ {
+ "id":"GB18030TEST",
+ "score":1.0005897,
+ "[interleaving]":"myModelB"},
+ {
+ "id":"UTF8TEST",
+ "score":0.79656565,
+ "[interleaving]":"myModelA"}]
+ }}
+----
+
+=== Running a Rerank Query Interleaving a Model with the Original Ranking
+When approaching Search Quality Evaluation with interleaving it may be useful to compare a model with the original ranking.
+To rerank the results of a query, interleaving a model with the original ranking, add the `rq` parameter to your search, passing the special inbuilt `_OriginalRanking_` model identifier as one model and your comparison model as the other model, for example:
+
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=_OriginalRanking_ model=myModel reRankDocs=100}&fl=id,score
+
+The addition of the `rq` parameter will not change the output of the search.
+
+To obtain the model that interleaving picked for a search result, computed during reranking, add `[interleaving]` to the `fl` parameter, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=_OriginalRanking_ model=myModel reRankDocs=100}&fl=id,score,[interleaving]
+
+The output will include the model picked for each search result, resembling the output shown here:
+
+[source,json]
+----
+{
+ "responseHeader":{
+ "status":0,
+ "QTime":0,
+ "params":{
+ "q":"test",
+ "fl":"id,score,[features]",
+ "rq":"{!ltr model=_OriginalRanking_ model=myModel reRankDocs=100}"}},
+ "response":{"numFound":2,"start":0,"maxScore":1.0005897,"docs":[
+ {
+ "id":"GB18030TEST",
+ "score":1.0005897,
+ "[interleaving]":"_OriginalRanking_"},
+ {
+ "id":"UTF8TEST",
+ "score":0.79656565,
+ "[interleaving]":"myModel"}]
+ }}
+----
+
+=== Running a Rerank Query with Interleaving Passing a Specific Algorithm
+To rerank the results of a query, interleaving two models using a specific algorithm, add the `interleavingAlgorithm` local parameter to the ltr query parser, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myModelA model=myModelB reRankDocs=100 interleavingAlgorithm=TeamDraft}&fl=id,score
+
+Currently the only (and default) algorithm supported is 'TeamDraft'.
+
+=== External Feature Information
+
+The {solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/ValueFeature.html[ValueFeature] and {solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/SolrFeature.html[SolrFeature] classes support the use of external feature information, `efi` for short.
+
+==== Uploading Features
+
+To upload features in a `/path/myEfiFeatures.json` file, please run:
+
+[source,bash]
+----
+curl -XPUT 'http://localhost:8983/solr/techproducts/schema/feature-store' --data-binary "@/path/myEfiFeatures.json" -H 'Content-type:application/json'
+----
+
+To view the features you just uploaded please open the following URL in a browser:
+
+[source,text]
+http://localhost:8983/solr/techproducts/schema/feature-store/myEfiFeatureStore
+
+.Example: /path/myEfiFeatures.json
+[source,json]
+----
+[
+ {
+ "store" : "myEfiFeatureStore",
+ "name" : "isPreferredManufacturer",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : { "fq" : [ "{!field f=manu}${preferredManufacturer}" ] }
+ },
+ {
+ "store" : "myEfiFeatureStore",
+ "name" : "userAnswerValue",
+ "class" : "org.apache.solr.ltr.feature.ValueFeature",
+ "params" : { "value" : "${answer:42}" }
+ },
+ {
+ "store" : "myEfiFeatureStore",
+ "name" : "userFromMobileValue",
+ "class" : "org.apache.solr.ltr.feature.ValueFeature",
+ "params" : { "value" : "${fromMobile}", "required" : true }
+ },
+ {
+ "store" : "myEfiFeatureStore",
+ "name" : "userTextCat",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : { "q" : "{!field f=cat}${text}" }
+ }
+]
+----
+
+As an aside, you may have noticed that the `myEfiFeatures.json` example uses `"store":"myEfiFeatureStore"` attributes: read more about feature `store` in the <<LTR Lifecycle>> section of this page.
+
+==== Extracting Features
+
+To extract `myEfiFeatureStore` features as part of a query, add `efi.*` parameters to the `[features]` part of the `fl` parameter, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&fl=id,cat,manu,score,[features store=myEfiFeatureStore efi.text=test efi.preferredManufacturer=Apache efi.fromMobile=1]
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&fl=id,cat,manu,score,[features store=myEfiFeatureStore efi.text=test efi.preferredManufacturer=Apache efi.fromMobile=0 efi.answer=13]
+
+==== Uploading a Model
+
+To upload the model in a `/path/myEfiModel.json` file, please run:
+
+[source,bash]
+----
+curl -XPUT 'http://localhost:8983/solr/techproducts/schema/model-store' --data-binary "@/path/myEfiModel.json" -H 'Content-type:application/json'
+----
+
+To view the model you just uploaded please open the following URL in a browser:
+
+[source,text]
+http://localhost:8983/solr/techproducts/schema/model-store
+
+.Example: /path/myEfiModel.json
+[source,json]
+----
+{
+ "store" : "myEfiFeatureStore",
+ "name" : "myEfiModel",
+ "class" : "org.apache.solr.ltr.model.LinearModel",
+ "features" : [
+ { "name" : "isPreferredManufacturer" },
+ { "name" : "userAnswerValue" },
+ { "name" : "userFromMobileValue" },
+ { "name" : "userTextCat" }
+ ],
+ "params" : {
+ "weights" : {
+ "isPreferredManufacturer" : 0.2,
+ "userAnswerValue" : 1.0,
+ "userFromMobileValue" : 1.0,
+ "userTextCat" : 0.1
+ }
+ }
+}
+----
+
+==== Running a Rerank Query
+
+To obtain the feature values computed during reranking, add `[features]` to the `fl` parameter and `efi.*` parameters to the `rq` parameter, for example:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myEfiModel efi.text=test efi.preferredManufacturer=Apache efi.fromMobile=1}&fl=id,cat,manu,score,[features]
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myEfiModel efi.text=test efi.preferredManufacturer=Apache efi.fromMobile=0 efi.answer=13}&fl=id,cat,manu,score,[features]
+
+Notice the absence of `efi.*` parameters in the `[features]` part of the `fl` parameter.
+
+==== Extracting Features While Reranking
+
+To extract features for `myEfiFeatureStore` features while still reranking with `myModel`:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=myModel}&fl=id,cat,manu,score,[features store=myEfiFeatureStore efi.text=test efi.preferredManufacturer=Apache efi.fromMobile=1]
+
+Notice the absence of `efi.\*` parameters in the `rq` parameter (because `myModel` does not use `efi` feature) and the presence of `efi.*` parameters in the `[features]` part of the `fl` parameter (because `myEfiFeatureStore` contains `efi` features).
+
+Read more about model evolution in the <<LTR Lifecycle>> section of this page.
+
+=== Training Example
+
- Example training data and a demo `train_and_upload_demo_model.py` script can be found in the `solr/modules/ltr/example` folder in the https://gitbox.apache.org/repos/asf?p=lucene-solr.git;a=tree;f=solr/modules/ltr/example[Apache lucene-solr Git repository] (mirrored on https://github.com/apache/lucene-solr/tree/releases/lucene-solr/{solr-docs-version}.0/solr/modules/ltr/example[github.com]).
++Example training data and a demo `train_and_upload_demo_model.py` script can be found in the `solr/modules/ltr/example` folder in the https://gitbox.apache.org/repos/asf?p=solr.git;a=tree;f=solr/modules/ltr/example[Apache lucene-solr Git repository] (mirrored on https://github.com/apache/lucene-solr/tree/releases/lucene-solr/{solr-full-version}/solr/modules/ltr/example[github.com]).
+This example folder is not shipped in the Solr binary release.
+
+== Installation of LTR
+
+The ltr module requires the `modules/ltr/lib/solr-ltr-*.jar` JARs.
+
+== LTR Configuration
+
+Learning-To-Rank is a module and therefore its plugins must be configured in `solrconfig.xml`.
+
+=== Minimum Requirements
+
+* Include the required module JARs.
+Note that by default paths are relative to the Solr core so they may need adjustments to your configuration, or an explicit specification of the `$solr.install.dir`.
++
+[source,xml]
+----
+<lib dir="${solr.install.dir:../../../..}/modules/ltr/lib/" regex=".*\.jar" />
+----
+
+* Declaration of the `ltr` query parser.
++
+[source,xml]
+----
+<queryParser name="ltr" class="org.apache.solr.ltr.search.LTRQParserPlugin"/>
+----
+
+* Configuration of the feature values cache.
++
+[source,xml]
+----
+<cache name="QUERY_DOC_FV"
+ class="solr.search.CaffeineCache"
+ size="4096"
+ initialSize="2048"
+ autowarmCount="4096"
+ regenerator="solr.search.NoOpRegenerator" />
+----
+
+* Declaration of the `[features]` transformer.
++
+[source,xml]
+----
+<transformer name="features" class="org.apache.solr.ltr.response.transform.LTRFeatureLoggerTransformerFactory">
+ <str name="fvCacheName">QUERY_DOC_FV</str>
+</transformer>
+----
+
+* Declaration of the `[interleaving]` transformer.
++
+[source,xml]
+----
+<transformer name="interleaving" class="org.apache.solr.ltr.response.transform.LTRInterleavingTransformerFactory"/>
+----
+
+=== Advanced Options
+
+==== LTRThreadModule
+
+A thread module can be configured for the query parser and/or the transformer to parallelize the creation of feature weights.
+For details, please refer to the {solr-javadocs}/modules/ltr/org/apache/solr/ltr/LTRThreadModule.html[LTRThreadModule] javadocs.
+
+==== Feature Vector Customization
+
+The features transformer returns dense CSV values such as `featureA=0.1,featureB=0.2,featureC=0.3,featureD=0.0`.
+
+For sparse CSV output such as `featureA:0.1 featureB:0.2 featureC:0.3` you can customize the {solr-javadocs}/modules/ltr/org/apache/solr/ltr/response/transform/LTRFeatureLoggerTransformerFactory.html[feature logger transformer] declaration in `solrconfig.xml` as follows:
+
+[source,xml]
+----
+<transformer name="features" class="org.apache.solr.ltr.response.transform.LTRFeatureLoggerTransformerFactory">
+ <str name="fvCacheName">QUERY_DOC_FV</str>
+ <str name="defaultFormat">sparse</str>
+ <str name="csvKeyValueDelimiter">:</str>
+ <str name="csvFeatureSeparator"> </str>
+</transformer>
+----
+
+==== Implementation and Contributions
+
+How does Solr Learning-To-Rank work under the hood?::
+Please refer to the `ltr` {solr-javadocs}/modules/ltr/org/apache/solr/ltr/package-summary.html[javadocs] for an implementation overview.
+
+How could I write additional models and/or features?::
+Contributions for further models, features, normalizers and interleaving algorithms are welcome.
+Related links:
++
+* {solr-javadocs}/modules/ltr/org/apache/solr/ltr/model/LTRScoringModel.html[LTRScoringModel javadocs]
+* {solr-javadocs}/modules/ltr/org/apache/solr/ltr/feature/Feature.html[Feature javadocs]
+* {solr-javadocs}/modules/ltr/org/apache/solr/ltr/norm/Normalizer.html[Normalizer javadocs]
+* {solr-javadocs}/modules/ltr/org/apache/solr/ltr/interleaving/Interleaving.html[Interleaving javadocs]
+* https://cwiki.apache.org/confluence/display/solr/HowToContribute
+* https://cwiki.apache.org/confluence/display/LUCENE/HowToContribute
+
+== LTR Lifecycle
+
+=== Feature Stores
+
+It is recommended that you organise all your features into stores which are akin to namespaces:
+
+* Features within a store must be named uniquely.
+* Across stores identical or similar features can share the same name.
+* If no store name is specified then the default `\_DEFAULT_` feature store will be used.
+
+To discover the names of all your feature stores:
+
+[source,text]
+http://localhost:8983/solr/techproducts/schema/feature-store
+
+To inspect the content of the `commonFeatureStore` feature store:
+
+[source,text]
+http://localhost:8983/solr/techproducts/schema/feature-store/commonFeatureStore
+
+=== Models
+
+* A model uses features from exactly one feature store.
+* If no store is specified then the default `\_DEFAULT_` feature store will be used.
+* A model need not use all the features defined in a feature store.
+* Multiple models can use the same feature store.
+
+To extract features for `currentFeatureStore` 's features:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&fl=id,score,[features store=currentFeatureStore]
+
+To extract features for `nextFeatureStore` features whilst reranking with `currentModel` based on `currentFeatureStore`:
+
+[source,text]
+http://localhost:8983/solr/techproducts/query?q=test&rq={!ltr model=currentModel reRankDocs=100}&fl=id,score,[features store=nextFeatureStore]
+
+To view all models:
+
+[source,text]
+http://localhost:8983/solr/techproducts/schema/model-store
+
+To delete the `currentModel` model:
+
+[source,bash]
+----
+curl -XDELETE 'http://localhost:8983/solr/techproducts/schema/model-store/currentModel'
+----
+
+IMPORTANT: A feature store may be deleted only when there are no models using it.
+
+To delete the `currentFeatureStore` feature store:
+
+[source,bash]
+----
+curl -XDELETE 'http://localhost:8983/solr/techproducts/schema/feature-store/currentFeatureStore'
+----
+
+==== Using Large Models
+
+With SolrCloud, large models may fail to upload due to the limitation of ZooKeeper's buffer.
+In this case, `DefaultWrapperModel` may help you to separate the model definition from uploaded file.
+
+Assuming that you consider to use a large model placed at `/path/to/models/myModel.json` through `DefaultWrapperModel`.
+
+[source,json]
+----
+{
+ "store" : "largeModelsFeatureStore",
+ "name" : "myModel",
+ "class" : ...,
+ "features" : [
+ ...
+ ],
+ "params" : {
+ ...
+ }
+}
+----
+
+First, add the directory to Solr's resource paths with a xref:configuration-guide:libs.adoc#lib-directives-in-solrconfig[`<lib/>` directive]:
+
+[source,xml]
+----
+ <lib dir="/path/to" regex="models" />
+----
+
+Then, configure `DefaultWrapperModel` to wrap `myModel.json`:
+
+[source,json]
+----
+{
+ "store" : "largeModelsFeatureStore",
+ "name" : "myWrapperModel",
+ "class" : "org.apache.solr.ltr.model.DefaultWrapperModel",
+ "params" : {
+ "resource" : "myModel.json"
+ }
+}
+----
+
+`myModel.json` will be loaded during the initialization and be able to use by specifying `model=myWrapperModel`.
+
+NOTE: No `"features"` are configured in `myWrapperModel` because the features of the wrapped model (`myModel`) will be used; also note that the `"store"` configured for the wrapper model must match that of the wrapped model i.e., in this example the feature store called `largeModelsFeatureStore` is used.
+
+CAUTION: `<lib dir="/path/to/models" regex=".*\.json" />` doesn't work as expected in this case, because `SolrResourceLoader` considers given resources as JAR if `<lib />` indicates files.
+
+As an alternative to the above-described `DefaultWrapperModel`, it is possible to xref:deployment-guide:zookeeper-ensemble.adoc#increasing-the-file-size-limit[increase ZooKeeper's file size limit].
+
+=== Applying Changes
+
+The feature store and the model store are both xref:configuration-guide:managed-resources.adoc[].
+Changes made to managed resources are not applied to the active Solr components until the Solr collection (or Solr core in single server mode) is reloaded.
+
+=== LTR Examples
+
+==== One Feature Store, Multiple Ranking Models
+
+* `leftModel` and `rightModel` both use features from `commonFeatureStore` and the only different between the two models is the weights attached to each feature.
+* Conventions used:
+** `commonFeatureStore.json` file contains features for the `commonFeatureStore` feature store
+** `leftModel.json` file contains model named `leftModel`
+** `rightModel.json` file contains model named `rightModel`
+** The model's features and weights are sorted alphabetically by name, this makes it easy to see what the commonalities and differences between the two models are.
+** The stores features are sorted alphabetically by name, this makes it easy to lookup features used in the models
+
+.Example: /path/commonFeatureStore.json
+[source,json]
+----
+[
+ {
+ "store" : "commonFeatureStore",
+ "name" : "documentRecency",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : {
+ "q" : "{!func}recip( ms(NOW,last_modified), 3.16e-11, 1, 1)"
+ }
+ },
+ {
+ "store" : "commonFeatureStore",
+ "name" : "isBook",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : {
+ "fq": [ "{!terms f=category}book" ]
+ }
+ },
+ {
+ "store" : "commonFeatureStore",
+ "name" : "originalScore",
+ "class" : "org.apache.solr.ltr.feature.OriginalScoreFeature",
+ "params" : {}
+ }
+]
+----
+
+.Example: /path/leftModel.json
+[source,json]
+----
+{
+ "store" : "commonFeatureStore",
+ "name" : "leftModel",
+ "class" : "org.apache.solr.ltr.model.LinearModel",
+ "features" : [
+ { "name" : "documentRecency" },
+ { "name" : "isBook" },
+ { "name" : "originalScore" }
+ ],
+ "params" : {
+ "weights" : {
+ "documentRecency" : 0.1,
+ "isBook" : 1.0,
+ "originalScore" : 0.5
+ }
+ }
+}
+----
+
+.Example: /path/rightModel.json
+[source,json]
+----
+{
+ "store" : "commonFeatureStore",
+ "name" : "rightModel",
+ "class" : "org.apache.solr.ltr.model.LinearModel",
+ "features" : [
+ { "name" : "documentRecency" },
+ { "name" : "isBook" },
+ { "name" : "originalScore" }
+ ],
+ "params" : {
+ "weights" : {
+ "documentRecency" : 1.0,
+ "isBook" : 0.1,
+ "originalScore" : 0.5
+ }
+ }
+}
+----
+
+==== Model Evolution
+
+* `linearModel201701` uses features from `featureStore201701`
+* `treesModel201702` uses features from `featureStore201702`
+* `linearModel201701` and `treesModel201702` and their feature stores can co-exist whilst both are needed.
+* When `linearModel201701` has been deleted then `featureStore201701` can also be deleted.
+* Conventions used:
+** `<store>.json` file contains features for the `<store>` feature store
+** `<model>.json` file contains model name `<model>`
+** a 'generation' id (e.g., `YYYYMM` year-month) is part of the feature store and model names
+** The model's features and weights are sorted alphabetically by name, this makes it easy to see what the commonalities and differences between the two models are.
+** The stores features are sorted alphabetically by name, this makes it easy to see what the commonalities and differences between the two feature stores are.
+
+.Example: /path/featureStore201701.json
+[source,json]
+----
+[
+ {
+ "store" : "featureStore201701",
+ "name" : "documentRecency",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : {
+ "q" : "{!func}recip( ms(NOW,last_modified), 3.16e-11, 1, 1)"
+ }
+ },
+ {
+ "store" : "featureStore201701",
+ "name" : "isBook",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : {
+ "fq": [ "{!terms f=category}book" ]
+ }
+ },
+ {
+ "store" : "featureStore201701",
+ "name" : "originalScore",
+ "class" : "org.apache.solr.ltr.feature.OriginalScoreFeature",
+ "params" : {}
+ }
+]
+----
+
+.Example: /path/linearModel201701.json
+[source,json]
+----
+{
+ "store" : "featureStore201701",
+ "name" : "linearModel201701",
+ "class" : "org.apache.solr.ltr.model.LinearModel",
+ "features" : [
+ { "name" : "documentRecency" },
+ { "name" : "isBook" },
+ { "name" : "originalScore" }
+ ],
+ "params" : {
+ "weights" : {
+ "documentRecency" : 0.1,
+ "isBook" : 1.0,
+ "originalScore" : 0.5
+ }
+ }
+}
+----
+
+.Example: /path/featureStore201702.json
+[source,json]
+----
+[
+ {
+ "store" : "featureStore201702",
+ "name" : "isBook",
+ "class" : "org.apache.solr.ltr.feature.SolrFeature",
+ "params" : {
+ "fq": [ "{!terms f=category}book" ]
+ }
+ },
+ {
+ "store" : "featureStore201702",
+ "name" : "originalScore",
+ "class" : "org.apache.solr.ltr.feature.OriginalScoreFeature",
+ "params" : {}
+ }
+]
+----
+
+.Example: /path/treesModel201702.json
+[source,json]
+----
+{
+ "store" : "featureStore201702",
+ "name" : "treesModel201702",
+ "class" : "org.apache.solr.ltr.model.MultipleAdditiveTreesModel",
+ "features" : [
+ { "name" : "isBook" },
+ { "name" : "originalScore" }
+ ],
+ "params" : {
+ "trees" : [
+ {
+ "weight" : "1",
+ "root" : {
+ "feature" : "isBook",
+ "threshold" : "0.5",
+ "left" : { "value" : "-100" },
+ "right" : {
+ "feature" : "originalScore",
+ "threshold" : "10.0",
+ "left" : { "value" : "50" },
+ "right" : { "value" : "75" }
+ }
+ }
+ },
+ {
+ "weight" : "2",
+ "root" : {
+ "value" : "-10"
+ }
+ }
+ ]
+ }
+}
+----
+
+== Additional LTR Resources
+
+* "Learning to Rank in Solr" presentation at Lucene/Solr Revolution 2015 in Austin:
+** Slides: http://www.slideshare.net/lucidworks/learning-to-rank-in-solr-presented-by-michael-nilsson-diego-ceccarelli-bloomberg-lp
+** Video: https://www.youtube.com/watch?v=M7BKwJoh96s
+
+* The importance of Online Testing in Learning To Rank:
+** Blog: https://sease.io/2020/04/the-importance-of-online-testing-in-learning-to-rank-part-1.html
+** Blog: https://sease.io/2020/05/online-testing-for-learning-to-rank-interleaving.html