get.asciidoc 527 B

12345678910111213141516171819
  1. [[get]]
  2. == Get API
  3. The get API is very similar to the
  4. // {javaclient}/java-docs-get.html[]
  5. Java get API. The main benefit
  6. of using groovy is handling the source content. It can be automatically
  7. converted to a `Map` which means using Groovy to navigate it is simple:
  8. [source,groovy]
  9. --------------------------------------------------
  10. def getF = node.client.get {
  11. index "test"
  12. type "_doc"
  13. id "1"
  14. }
  15. println "Result of field2: $getF.response.source.complex.field2"
  16. --------------------------------------------------