Skip to content

Update generated documentation #5560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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`::

Expand Down Expand Up @@ -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.
Expand Down
36 changes: 35 additions & 1 deletion docs/client-concepts/high-level/mapping/fluent-mapping.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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))"
}
}
Expand All @@ -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<Company>(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."
}
}
}
}
}
}
----

3 changes: 1 addition & 2 deletions docs/search/searching-runtime-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -139,7 +138,7 @@ var searchRequest = new SearchRequest<Project>
{ "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())}")
}
}
}
Expand Down