mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 13:08:29 +00:00
5cff2a046d
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.
20 lines
522 B
Plaintext
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"
|
|
--------------------------------------------------
|