Skip to content

Commit 006603f

Browse files
authored
Update generated documentation (#5560)
1 parent 37218f3 commit 006603f

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

docs/client-concepts/connection/configuration-options.asciidoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ IMPORTANT: Depending on the registered serializer, this may cause the response t
6666

6767
`DisableMetaHeader`::
6868

69-
Disables the meta header which is included on all requests by default. This header contains lightweight information about the client and runtime.
69+
Disables the meta header which is included on all requests by default. This header contains lightweight information about the client and runtime.
7070

7171
`DisablePing`::
7272

@@ -122,6 +122,10 @@ Limits the total runtime, including retries, separately from `RequestTimeout`
122122
+
123123
When not specified, defaults to `RequestTimeout` , which itself defaults to `60` seconds
124124

125+
`MemoryStreamFactory`::
126+
127+
The memory stream factory to use, defaults to `Default`
128+
125129
`NodePredicate`::
126130

127131
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.

docs/client-concepts/high-level/mapping/fluent-mapping.asciidoc

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ var createIndexResponse = _client.Indices.Create("myindex", c => c
405405
"birthDayOfWeek": {
406406
"type": "keyword",
407407
"script": {
408-
"lang": "painless",
409408
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
410409
}
411410
}
@@ -427,3 +426,38 @@ createIndexResponse = _client.Indices.Create("myindex", c => c
427426
);
428427
----
429428

429+
One may also include and use parameters in the script.
430+
431+
[source,csharp]
432+
----
433+
createIndexResponse = _client.Indices.Create("myindex", c => c
434+
.Map<Company>(m => m
435+
.RuntimeFields(rtf => rtf
436+
.RuntimeField("birthDayOfWeek", FieldType.Keyword, f => f
437+
.Script(s => s
438+
.Source("emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT) + params.suffix)")
439+
.Params(p => p.Add("suffix", " with a suffix."))
440+
)))
441+
)
442+
);
443+
----
444+
445+
[source,javascript]
446+
----
447+
{
448+
"mappings": {
449+
"runtime": {
450+
"birthDayOfWeek": {
451+
"type": "keyword",
452+
"script": {
453+
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT) + params.suffix)",
454+
"params": {
455+
"suffix": " with a suffix."
456+
}
457+
}
458+
}
459+
}
460+
}
461+
}
462+
----
463+

docs/search/searching-runtime-fields.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ which yields the following query JSON
114114
"runtime_mappings": {
115115
"search_runtime_field": {
116116
"script": {
117-
"lang": "painless",
118117
"source": "if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}"
119118
},
120119
"type": "keyword"
@@ -139,7 +138,7 @@ var searchRequest = new SearchRequest<Project>
139138
{ "search_runtime_field", new RuntimeField
140139
{
141140
Type = FieldType.Keyword,
142-
Script = new PainlessScript("if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}")
141+
Script = new InlineScript("if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}")
143142
}
144143
}
145144
}

0 commit comments

Comments
 (0)