Tutorial by Examples

def param = 'string' def str = "Double quoted ${param}" assert str instanceof GString assert str == 'Double quoted string' The parameter is by default resolved eagerly, this means this applies: def param = 'string' def str = "Double quoted ${param}" param = 'another stri...
def str = '''multiline string''' assert str instanceof String
def str = ''' multiline string''' assert str.readLines().size() == 3
def str = '''\ multiline string''' assert str.readLines().size() == 2
def param = 'string' def str = """ multiline $param """ assert str instanceof GString assert str.readLines().size() == 3 assert str == ''' multiline string '''
def str = / multiline string no need to escape slash \n / assert str instanceof String assert str.readLines().size() == 4 assert str.contains('\\n')
def param = 'string' def str = / multiline $param no need to escape slash \n / assert str instanceof GString assert str.readLines().size() == 4 assert str.contains('\\n') assert str.contains('string')
def param = 'string' def str = $/ multiline $param no need to escape slash \n $ $$ /$ assert str instanceof GString assert str.readLines().size() == 6 assert str.contains('\\n') assert str.contains('$')
All functions to interact with coroutines are avaliable in the coroutine table. A new coroutine is created by using the coroutine.create function with a single argument: a function with the code to be executed: thread1 = coroutine.create(function() print("honk") end)...
Python 2 includes a cmp function which allows you to determine if one object is less than, equal to, or greater than another object. This function can be used to pick a choice out of a list based on one of those three options. Suppose you need to print 'greater than' if x > y, 'less than' if x &...
Elasticsearch uses a YAML (Yet Another Markup Language) configuration file that can be found inside the default Elasticsearch directory (RPM and DEB installs change this location amongst other things). You can set basic settings in config/elasticsearch.yml: # Change the cluster name. All nodes in ...
If you need to apply a setting dynamically after the cluster has already started, and it can actually be set dynamically, then you can set it using _cluster/settings API. Persistent settings are one of the two type of cluster-wide settings that can be applied. A persistent setting will survive a fu...
If you need to apply a setting dynamically after the cluster has already started, and it can actually be set dynamically, then you can set it using _cluster/settings API. Transient settings are one of the two type of cluster-wide settings that can be applied. A transient setting will not survive a ...
Index settings are those settings that apply to a single index. Such settings will start with index.. The exception to that rule is number_of_shards and number_of_replicas, which also exist in the form of index.number_of_shards and index.number_of_replicas. As the name suggests, index-level setting...
You can apply the same change shown in the Index Settings example to all existing indices with one request, or even a subset of them: PUT /*/_settings { "index": { "indexing.slowlog.threshold.index.warn": "1s", "search.slowlog.threshold": { ...
Example uses basic HTTP, which translate easily to cURL and other HTTP applications. They also match the Sense syntax, which will be renamed to Console in Kibana 5.0. Note: The example inserts <#> to help draw attention to parts. Those should be removed if you copy it! PUT /my_index <1&gt...
Example uses basic HTTP, which translate easily to cURL and other HTTP applications. They also match the Sense syntax, which will be renamed to Console in Kibana 5.0. Note: The example inserts <#> to help draw attention to parts. Those should be removed if you copy it! DELETE /my_index <1...
Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. You can use the _cat APIs to get a human readable, tabular output for various reasons. GET /_cat/health <1> _cat/health has existed since Elasticsearch 1.x, but here is an example of its output...
Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. Like most _cat APIs in Elasticsearch, the API selectively responds with a default set of fields. However, other fields exist from the API if you want them: GET /_cat/health?help <1> ?help cau...
Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. The _cat APIs are often convenient for humans to get at-a-glance details about the cluster. But you frequently want consistently parseable output to use with software. In general, the JSON APIs are meant...

Page 452 of 1336