Class ScriptDescriptorBase<TDescriptor, TInterface>
A script to execute to provide custom computation
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public abstract class ScriptDescriptorBase<TDescriptor, TInterface> : DescriptorBase<TDescriptor, TInterface>, IDescriptor, IScript where TDescriptor : ScriptDescriptorBase<TDescriptor, TInterface>, TInterface, IScript where TInterface : class, IScript
Type Parameters
| Name | Description |
|---|---|
| TDescriptor | |
| TInterface |
Methods
| Edit this page View SourceLang(ScriptLang)
Language of script.
Declaration
public TDescriptor Lang(ScriptLang lang)
Parameters
| Type | Name | Description |
|---|---|---|
| ScriptLang | lang | language |
Returns
| Type | Description |
|---|---|
| TDescriptor | this |
Lang(string)
Language of script.
Declaration
public TDescriptor Lang(string lang)
Parameters
| Type | Name | Description |
|---|---|---|
| string | lang | language |
Returns
| Type | Description |
|---|---|
| TDescriptor | this |
Params(Dictionary<string, object>)
Scripts are compiled and cached for faster execution. If the same script can be used, just with different parameters provided, it is preferable to use the ability to pass parameters to the script itself.
Declaration
public TDescriptor Params(Dictionary<string, object> scriptParams)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, object> | scriptParams |
Returns
| Type | Description |
|---|---|
| TDescriptor | this |
Examples
script: "doc['num1'].value > param1" param: "param1" = 5
| Edit this page View SourceParams(Func<FluentDictionary<string, object>, FluentDictionary<string, object>>)
Scripts are compiled and cached for faster execution. If the same script can be used, just with different parameters provided, it is preferable to use the ability to pass parameters to the script itself.
Declaration
public TDescriptor Params(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> paramsDictionary)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<FluentDictionary<string, object>, FluentDictionary<string, object>> | paramsDictionary | param |
Returns
| Type | Description |
|---|---|
| TDescriptor | this |
Examples
script: "doc['num1'].value > param1" param: "param1" = 5