Docs change for exists query. (#43092)

Docs change for exists query. (#43092)

Now emphasises the test is for indexed values.
Previous documentation only mentioned the state of the input JSON doc (null values) but this is only one of several reasons why an indexed value may not exist.

Closes #24256

[[query-dsl-exists-query]]
=== Exists Query

Returns documents that contain an indexed value for a field.

An indexed value may not exist for a document's field due to a variety of reasons:

* The field in the source JSON is `null` or `[]`
* The field has `"index" : false` set in the mapping
* The length of the field value exceeded an `ignore_above` setting in the mapping
* The field value was malformed and `ignore_malformed` was defined in the mapping

[[exists-query-ex-request]]
==== Example request

[source,js]
----
GET /_search
{
    "query": {
        "exists": {
            "field": "user"
        }
    }
}
----
// CONSOLE

[[exists-query-top-level-params]]
==== Top-level parameters for `exists`
`field`::
Name of the field you wish to search.
+
While a field is deemed non-existant if the JSON value is `null` or `[]`, these values will indicate the field does exist:
+
* Empty strings, such as `""` or `"-"`
* Arrays containing `null` and another value, such as `[null, "foo"]`
* A custom <<null-value, `null-value`>>, defined in field mapping

[[exists-query-notes]]
==== Notes

[[find-docs-null-values]]
===== Find documents missing indexed values
To find documents that are missing an indexed value for a field,
use the `must_not` <<query-dsl-bool-query, boolean query>> with the `exists`
query.

The following search returns documents that are missing an indexed value for
the `user` field.

[source,js]
----
GET /_search
{
    "query": {
        "bool": {
            "must_not": {
                "exists": {
                    "field": "user"
                }
            }
        }
    }
}
----
// CONSOLE

[[query-dsl-exists-query]]
=== Exists Query

Returns documents that contain a value other than `null` or `[]` in a provided
field.

[[exists-query-ex-request]]
==== Example request

[source,js]
----
GET /_search
{
    "query": {
        "exists": {
            "field": "user"
        }
    }
}
----
// CONSOLE

[[exists-query-top-level-params]]
==== Top-level parameters for `exists`
`field`::
Name of the field you wish to search.
+
To return a document, this field must exist and contain a value other
than `null` or `[]`. These values can include:
+
* Empty strings, such as `""` or `"-"`
* Arrays containing `null` and another value, such as `[null, "foo"]`
* A custom <<null-value, `null-value`>>, defined in field mapping

[[exists-query-notes]]
==== Notes

[[find-docs-null-values]]
===== Find documents with null values
To find documents that contain only `null` values or `[]` in a provided field,
use the `must_not` <<query-dsl-bool-query, boolean query>> with the `exists`
query.

The following search returns documents that contain only `null` values or `[]`
in the `user` field.

[source,js]
----
GET /_search
{
    "query": {
        "bool": {
            "must_not": {
                "exists": {
                    "field": "user"
                }
            }
        }
    }
}
----
// CONSOLE


[DOCS] Add community supported MSI installer to docs

[[setup-service-win]]
== Running as a Service on Windows

Windows users can configure Elasticsearch to run as a service to run in the background or start automatically
at startup without any user interaction.
This can be achieved through `service.bat` script under `bin/` folder which allows one to install,
remove, manage or configure the service and potentially start and stop the service, all from the command-line.

[source,sh]
--------------------------------------------------
c:\elasticsearch-0.90.5\bin>service

Usage: service.bat install|remove|start|stop|manager [SERVICE_ID]
--------------------------------------------------

The script requires one parameter (the command to execute) followed by an optional one indicating the service
id (useful when installing multiple Elasticsearch services).

The commands available are:

[horizontal]
`install`:: Install Elasticsearch as a service

`remove`:: Remove the installed Elasticsearch service (and stop the service if started)

`start`:: Start the Elasticsearch service (if installed)

`stop`:: Stop the Elasticsearch service (if started)

`manager`:: Start a GUI for managing the installed service

Note that the environment configuration options available during the installation are copied and will be used during
the service lifecycle. This means any changes made to them after the installation will not be picked up unless
the service is reinstalled.

Based on the architecture of the available JDK/JRE (set through `JAVA_HOME`), the appropriate 64-bit(x64) or 32-bit(x86)
service will be installed. This information is made available during install:

[source,sh]
--------------------------------------------------
c:\elasticsearch-0.90.5\bin>service install
Installing service      :  "elasticsearch-service-x64"
Using JAVA_HOME (64-bit):  "c:\jvm\jdk1.7"
The service 'elasticsearch-service-x64' has been installed.
--------------------------------------------------

NOTE: While a JRE can be used for the Elasticsearch service, due to its use of a client VM (as oppose to a server JVM which
offers better performance for long-running applications) its usage is discouraged and a warning will be issued.

[float]
=== Customizing service settings

There are two ways to customize the service settings:

Manager GUI:: accessible through `manager` command, the GUI offers insight into the installed service including its status, startup type,
JVM, start and stop settings among other things. Simply invoking `service.bat` from the command-line with the aforementioned option
will open up the manager window:

image::images/service-manager-win.png["Windows Service Manager GUI",align="center"]

Customizing `service.bat`:: at its core, `service.bat` relies on http://commons.apache.org/proper/commons-daemon/[Apache Commons Daemon] project
to install the services. For full flexibility such as customizing the user under which the service runs, one can modify the installation
parameters to tweak all the parameters accordingly. Do note that this requires reinstalling the service for the new settings to be applied.

NOTE: There is also a community supported customizable MSI installer available: https://github.com/salyh/elasticsearch-msi-installer (by Hendrik Saly).


Update 2015-03-22-Hallo-Welt.adoc

Update 2015-03-22-Hallo-Welt.adoc


Updated UDC disable docs

Updated UDC disable docs

[[usage-data-collector]]
Usage Data Collector
====================

The Neo4j Usage Data Collector is a sub-system that gathers usage data, reporting it to the UDC-server at udc.neo4j.org.
It is easy to disable, and does not collect any data that is confidential. For more information about what is being sent, see below.

The Neo4j team uses this information as a form of automatic, effortless feedback from the Neo4j community.
We want to verify that we are doing the right thing by matching download statistics with usage statistics.
After each release, we can see if there is a larger retention span of the server software.

The data collected is clearly stated here.
If any future versions of this system collect additional data, we will clearly announce those changes.

The Neo4j team is very concerned about your privacy. We do not disclose any personally identifiable information.

== Technical Information ==

To gather good statistics about Neo4j usage, UDC collects this information:

* Kernel version: The build number, and if there are any modifications to the kernel.
* Store id: A randomized globally unique id created at the same time a database is created.
* Ping count: UDC holds an internal counter which is incremented for every ping, and reset for every restart of the kernel.
* Source: This is either "neo4j" or "maven". If you downloaded Neo4j from the Neo4j website, it's "neo4j", if you are using Maven to get Neo4j, it will be "maven".
* Java version: The referrer string shows which version of Java is being used.
* MAC address to uniquely identify instances behind firewalls.
* Registration id: For registered server instances.
* Tags about the execution context (e.g. test, language, web-container, app-container, spring, ejb).
* Neo4j Edition (community, enterprise).
* A hash of the current cluster name (if any).
* Distribution information for Linux (rpm, dpkg, unknown).
* User-Agent header for tracking usage of REST client drivers

After startup, UDC waits for ten minutes before sending the first ping. It does this for two reasons; first, we don't want the startup to be slower because of UDC, and secondly, we want to keep pings from automatic tests to a minimum. The ping to the UDC servers is done with a HTTP GET.

== How to disable UDC ==

We've tried to make it extremely easy to disable UDC. In fact, the code for UDC is not even included in the kernel jar but as a completely separate component.

There are three ways you can disable UDC:

. The easiest way is to just remove the neo4j-udc-*.jar file. By doing this, the kernel will not load UDC, and no pings will be sent.

. If you are using Maven, and want to make sure that UDC is never installed in your system, a dependency element like this will do that:
+
[source,xml]
--------------------
 <dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j</artifactId>
   <version>${neo4j-version}</version>
   <exclusions>
     <exclusion>
       <groupId>org.neo4j</groupId>
       <artifactId>neo4j-udc</artifactId>
     </exclusion>
   </exclusions>
 </dependency>
--------------------
+
_Where $\{neo4j-version} is the Neo4j version in use._

. Lastly, if you are using a packaged version of Neo4j, and do not want to make any change to the jars, a system property setting like this will also make sure that UDC is never activated: +-Dneo4j.ext.udc.enabled=false+.

[[usage-data-collector]]
Usage Data Collector
====================

The Neo4j Usage Data Collector is a sub-system that gathers usage data, reporting it to the UDC-server at udc.neo4j.org.
It is easy to disable, and does not collect any data that is confidential. For more information about what is being sent, see below.

The Neo4j team uses this information as a form of automatic, effortless feedback from the Neo4j community.
We want to verify that we are doing the right thing by matching download statistics with usage statistics.
After each release, we can see if there is a larger retention span of the server software.

The data collected is clearly stated here.
If any future versions of this system collect additional data, we will clearly announce those changes.

The Neo4j team is very concerned about your privacy. We do not disclose any personally identifiable information.

== Technical Information ==

To gather good statistics about Neo4j usage, UDC collects this information:

* Kernel version: The build number, and if there are any modifications to the kernel.
* Store id: A randomized globally unique id created at the same time a database is created.
* Ping count: UDC holds an internal counter which is incremented for every ping, and reset for every restart of the kernel.
* Source: This is either "neo4j" or "maven". If you downloaded Neo4j from the Neo4j website, it's "neo4j", if you are using Maven to get Neo4j, it will be "maven".
* Java version: The referrer string shows which version of Java is being used.
* MAC address to uniquely identify instances behind firewalls.
* Registration id: For registered server instances.
* Tags about the execution context (e.g. test, language, web-container, app-container, spring, ejb).
* Neo4j Edition (community, enterprise).
* A hash of the current cluster name (if any).
* Distribution information for Linux (rpm, dpkg, unknown).
* User-Agent header for tracking usage of REST client drivers

After startup, UDC waits for ten minutes before sending the first ping. It does this for two reasons; first, we don't want the startup to be slower because of UDC, and secondly, we want to keep pings from automatic tests to a minimum. The ping to the UDC servers is done with a HTTP GET.

== How to disable UDC ==

We've tried to make it extremely easy to disable UDC. In fact, the code for UDC is not even included in the kernel jar but as a completely separate component.

There are three ways you can disable UDC:

. The easiest way is to just remove the neo4j-udc-*.jar file. By doing this, the kernel will not load UDC, and no pings will be sent.

. If you are using Maven, and want to make sure that UDC is never installed in your system, a dependency element like this will do that:
+
[source,xml]
--------------------
 <dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j</artifactId>
   <version>${neo4j-version}</version>
   <exclusions>
     <exclusion>
       <groupId>org.neo4j</groupId>
       <artifactId>neo4j-udc</artifactId>
     </exclusion>
   </exclusions>
 </dependency>
--------------------
+
_Where $\{neo4j-version} is the Neo4j version in use._

. Lastly, if you are using a packaged version of Neo4j, and do not want to make any change to the jars, a system property setting like this will also make sure that UDC is never activated: +-Dneo4j.ext.udc.disable=true+.