"Fossies" - the Fresh Open Source Software Archive

Member "elasticsearch-6.8.5/docs/groovy-api/get.asciidoc" (13 Nov 2019, 527 Bytes) of package /linux/www/elasticsearch-6.8.5-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming AsciiDoc format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Get API

The get API is very similar to the 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:

def getF = node.client.get {
    index "test"
    type "_doc"
    id "1"
}

println "Result of field2: $getF.response.source.complex.field2"