diff options
author | Hilko Bengen <bengen@debian.org> | 2014-06-07 12:02:12 +0200 |
---|---|---|
committer | Hilko Bengen <bengen@debian.org> | 2014-06-07 12:02:12 +0200 |
commit | d5ed89b946297270ec28abf44bef2371a06f1f4f (patch) | |
tree | ce2d945e4dde69af90bd9905a70d8d27f4936776 /docs/java-api/get.asciidoc | |
download | elasticsearch-d5ed89b946297270ec28abf44bef2371a06f1f4f.tar.gz |
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'docs/java-api/get.asciidoc')
-rw-r--r-- | docs/java-api/get.asciidoc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/java-api/get.asciidoc b/docs/java-api/get.asciidoc new file mode 100644 index 0000000..c87dbef --- /dev/null +++ b/docs/java-api/get.asciidoc @@ -0,0 +1,38 @@ +[[get]] +== Get API + +The get API allows to get a typed JSON document from the index based on +its id. The following example gets a JSON document from an index called +twitter, under a type called tweet, with id valued 1: + +[source,java] +-------------------------------------------------- +GetResponse response = client.prepareGet("twitter", "tweet", "1") + .execute() + .actionGet(); +-------------------------------------------------- + +For more information on the get operation, check out the REST +{ref}/docs-get.html[get] docs. + + +=== Operation Threading + +The get API allows to set the threading model the operation will be +performed when the actual execution of the API is performed on the same +node (the API is executed on a shard that is allocated on the same +server). + +The options are to execute the operation on a different thread, or to +execute it on the calling thread (note that the API is still async). By +default, `operationThreaded` is set to `true` which means the operation +is executed on a different thread. Here is an example that sets it to +`false`: + +[source,java] +-------------------------------------------------- +GetResponse response = client.prepareGet("twitter", "tweet", "1") + .setOperationThreaded(false) + .execute() + .actionGet(); +-------------------------------------------------- |