From ad06c4110ef70b4cb1f595e355111b6571570d23 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Wed, 21 Apr 2021 06:27:10 +0100 Subject: [PATCH] Update generated documentation --- .../connection/configuration-options.asciidoc | 6 +++- .../mapping/fluent-mapping.asciidoc | 36 ++++++++++++++++++- docs/search/searching-runtime-fields.asciidoc | 3 +- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/docs/client-concepts/connection/configuration-options.asciidoc b/docs/client-concepts/connection/configuration-options.asciidoc index 6d1d8b960ea..832952f790c 100644 --- a/docs/client-concepts/connection/configuration-options.asciidoc +++ b/docs/client-concepts/connection/configuration-options.asciidoc @@ -66,7 +66,7 @@ IMPORTANT: Depending on the registered serializer, this may cause the response t `DisableMetaHeader`:: -Disables the meta header which is included on all requests by default. This header contains lightweight information about the client and runtime. +Disables the meta header which is included on all requests by default. This header contains lightweight information about the client and runtime. `DisablePing`:: @@ -122,6 +122,10 @@ Limits the total runtime, including retries, separately from `RequestTimeout` + When not specified, defaults to `RequestTimeout` , which itself defaults to `60` seconds +`MemoryStreamFactory`:: + +The memory stream factory to use, defaults to `Default` + `NodePredicate`:: Register a predicate to select which nodes that you want to execute API calls on. Note that sniffing requests omit this predicate and always execute on all nodes. When using an `IConnectionPool` implementation that supports reseeding of nodes, this will default to omitting master only node from regular API calls. When using static or single node connection pooling it is assumed the list of node you instantiate the client with should be taken verbatim. diff --git a/docs/client-concepts/high-level/mapping/fluent-mapping.asciidoc b/docs/client-concepts/high-level/mapping/fluent-mapping.asciidoc index 242c4cdae6c..8a0bafc9484 100644 --- a/docs/client-concepts/high-level/mapping/fluent-mapping.asciidoc +++ b/docs/client-concepts/high-level/mapping/fluent-mapping.asciidoc @@ -405,7 +405,6 @@ var createIndexResponse = _client.Indices.Create("myindex", c => c "birthDayOfWeek": { "type": "keyword", "script": { - "lang": "painless", "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))" } } @@ -427,3 +426,38 @@ createIndexResponse = _client.Indices.Create("myindex", c => c ); ---- +One may also include and use parameters in the script. + +[source,csharp] +---- +createIndexResponse = _client.Indices.Create("myindex", c => c + .Map(m => m + .RuntimeFields(rtf => rtf + .RuntimeField("birthDayOfWeek", FieldType.Keyword, f => f + .Script(s => s + .Source("emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT) + params.suffix)") + .Params(p => p.Add("suffix", " with a suffix.")) + ))) + ) +); +---- + +[source,javascript] +---- +{ + "mappings": { + "runtime": { + "birthDayOfWeek": { + "type": "keyword", + "script": { + "source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT) + params.suffix)", + "params": { + "suffix": " with a suffix." + } + } + } + } + } +} +---- + diff --git a/docs/search/searching-runtime-fields.asciidoc b/docs/search/searching-runtime-fields.asciidoc index 31c27f50305..ff438e3ad95 100644 --- a/docs/search/searching-runtime-fields.asciidoc +++ b/docs/search/searching-runtime-fields.asciidoc @@ -114,7 +114,6 @@ which yields the following query JSON "runtime_mappings": { "search_runtime_field": { "script": { - "lang": "painless", "source": "if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}" }, "type": "keyword" @@ -139,7 +138,7 @@ var searchRequest = new SearchRequest { "search_runtime_field", new RuntimeField { Type = FieldType.Keyword, - Script = new PainlessScript("if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}") + Script = new InlineScript("if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}") } } }