OpenSearch/docs/groovy-api/get.asciidoc
Nik Everett 5cff2a046d Remove most of the need for // NOTCONSOLE
and be much more stingy about what we consider a console candidate.

* Add `// CONSOLE` to check-running
* Fix version in some snippets
* Mark groovy snippets as groovy
* Fix versions in plugins
* Fix language marker errors
* Fix language parsing in snippets

  This adds support for snippets who's language is written like
  `[source, txt]` and `["source","js",subs="attributes,callouts"]`.

  This also makes language required for snippets which is nice because
  then we can be sure we can grep for snippets in a particular language.
2016-09-06 10:32:54 -04:00

20 lines
522 B
Plaintext

[[get]]
== Get API
The get API is very similar to the
// {java}/java-docs-get.html[]
Java get API. The main benefit
of using groovy is handling the source content. It can be automatically
converted to a `Map` which means using Groovy to navigate it is simple:
[source,groovy]
--------------------------------------------------
def getF = node.client.get {
index "test"
type "type1"
id "1"
}
println "Result of field2: $getF.response.source.complex.field2"
--------------------------------------------------