OpenSearch/docs/groovy-api/get.asciidoc
Julie Tibshirani f854330e06
Make sure to use the type _doc in the REST documentation. (#34662)
* Replace custom type names with _doc in REST examples.
* Avoid using two mapping types in the percolator docs.
* Rename doc -> _doc in the main repository README.
* Also replace some custom type names in the HLRC docs.
2018-10-22 11:54:04 -07:00

20 lines
527 B
Plaintext

[[get]]
== Get API
The get API is very similar to the
// {javaclient}/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 "_doc"
id "1"
}
println "Result of field2: $getF.response.source.complex.field2"
--------------------------------------------------