Class ElasticsearchQueryRulesClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchQueryRulesClient
(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptiondeleteRule
(DeleteRuleRequest request) Delete a query rule.final DeleteRuleResponse
Delete a query rule.deleteRuleset
(DeleteRulesetRequest request) Delete a query ruleset.final DeleteRulesetResponse
Delete a query ruleset.getRule
(GetRuleRequest request) Get a query rule.final GetRuleResponse
Get a query rule.getRuleset
(GetRulesetRequest request) Get a query ruleset.final GetRulesetResponse
Get a query ruleset.Get all query rulesets.listRulesets
(ListRulesetsRequest request) Get all query rulesets.final ListRulesetsResponse
Get all query rulesets.putRule
(PutRuleRequest request) Create or update a query rule.final PutRuleResponse
Create or update a query rule.putRuleset
(PutRulesetRequest request) Create or update a query ruleset.final PutRulesetResponse
Create or update a query ruleset.test
(TestRequest request) Test a query ruleset.final TestResponse
Test a query ruleset.withTransportOptions
(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchQueryRulesClient
-
ElasticsearchQueryRulesClient
public ElasticsearchQueryRulesClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
public ElasticsearchQueryRulesClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClient
Creates a new client with some request options- Specified by:
withTransportOptions
in classApiClient<ElasticsearchTransport,
ElasticsearchQueryRulesClient>
-
deleteRule
public DeleteRuleResponse deleteRule(DeleteRuleRequest request) throws IOException, ElasticsearchException Delete a query rule. Delete a query rule within a query ruleset. This is a destructive action that is only recoverable by re-adding the same rule with the create or update query rule API.- Throws:
IOException
ElasticsearchException
- See Also:
-
deleteRule
public final DeleteRuleResponse deleteRule(Function<DeleteRuleRequest.Builder, ObjectBuilder<DeleteRuleRequest>> fn) throws IOException, ElasticsearchExceptionDelete a query rule. Delete a query rule within a query ruleset. This is a destructive action that is only recoverable by re-adding the same rule with the create or update query rule API.- Parameters:
fn
- a function that initializes a builder to create theDeleteRuleRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
deleteRuleset
public DeleteRulesetResponse deleteRuleset(DeleteRulesetRequest request) throws IOException, ElasticsearchException Delete a query ruleset. Remove a query ruleset and its associated data. This is a destructive action that is not recoverable.- Throws:
IOException
ElasticsearchException
- See Also:
-
deleteRuleset
public final DeleteRulesetResponse deleteRuleset(Function<DeleteRulesetRequest.Builder, ObjectBuilder<DeleteRulesetRequest>> fn) throws IOException, ElasticsearchExceptionDelete a query ruleset. Remove a query ruleset and its associated data. This is a destructive action that is not recoverable.- Parameters:
fn
- a function that initializes a builder to create theDeleteRulesetRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
getRule
Get a query rule. Get details about a query rule within a query ruleset.- Throws:
IOException
ElasticsearchException
- See Also:
-
getRule
public final GetRuleResponse getRule(Function<GetRuleRequest.Builder, ObjectBuilder<GetRuleRequest>> fn) throws IOException, ElasticsearchExceptionGet a query rule. Get details about a query rule within a query ruleset.- Parameters:
fn
- a function that initializes a builder to create theGetRuleRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
getRuleset
public GetRulesetResponse getRuleset(GetRulesetRequest request) throws IOException, ElasticsearchException Get a query ruleset. Get details about a query ruleset.- Throws:
IOException
ElasticsearchException
- See Also:
-
getRuleset
public final GetRulesetResponse getRuleset(Function<GetRulesetRequest.Builder, ObjectBuilder<GetRulesetRequest>> fn) throws IOException, ElasticsearchExceptionGet a query ruleset. Get details about a query ruleset.- Parameters:
fn
- a function that initializes a builder to create theGetRulesetRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
listRulesets
public ListRulesetsResponse listRulesets(ListRulesetsRequest request) throws IOException, ElasticsearchException Get all query rulesets. Get summarized information about the query rulesets.- Throws:
IOException
ElasticsearchException
- See Also:
-
listRulesets
public final ListRulesetsResponse listRulesets(Function<ListRulesetsRequest.Builder, ObjectBuilder<ListRulesetsRequest>> fn) throws IOException, ElasticsearchExceptionGet all query rulesets. Get summarized information about the query rulesets.- Parameters:
fn
- a function that initializes a builder to create theListRulesetsRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
listRulesets
Get all query rulesets. Get summarized information about the query rulesets.- Throws:
IOException
ElasticsearchException
- See Also:
-
putRule
Create or update a query rule. Create or update a query rule within a query ruleset.IMPORTANT: Due to limitations within pinned queries, you can only pin documents using ids or docs, but cannot use both in single rule. It is advised to use one or the other in query rulesets, to avoid errors. Additionally, pinned queries have a maximum limit of 100 pinned hits. If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.
- Throws:
IOException
ElasticsearchException
- See Also:
-
putRule
public final PutRuleResponse putRule(Function<PutRuleRequest.Builder, ObjectBuilder<PutRuleRequest>> fn) throws IOException, ElasticsearchExceptionCreate or update a query rule. Create or update a query rule within a query ruleset.IMPORTANT: Due to limitations within pinned queries, you can only pin documents using ids or docs, but cannot use both in single rule. It is advised to use one or the other in query rulesets, to avoid errors. Additionally, pinned queries have a maximum limit of 100 pinned hits. If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.
- Parameters:
fn
- a function that initializes a builder to create thePutRuleRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
putRuleset
public PutRulesetResponse putRuleset(PutRulesetRequest request) throws IOException, ElasticsearchException Create or update a query ruleset. There is a limit of 100 rules per ruleset. This limit can be increased by using thexpack.applications.rules.max_rules_per_ruleset
cluster setting.IMPORTANT: Due to limitations within pinned queries, you can only select documents using
ids
ordocs
, but cannot use both in single rule. It is advised to use one or the other in query rulesets, to avoid errors. Additionally, pinned queries have a maximum limit of 100 pinned hits. If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.- Throws:
IOException
ElasticsearchException
- See Also:
-
putRuleset
public final PutRulesetResponse putRuleset(Function<PutRulesetRequest.Builder, ObjectBuilder<PutRulesetRequest>> fn) throws IOException, ElasticsearchExceptionCreate or update a query ruleset. There is a limit of 100 rules per ruleset. This limit can be increased by using thexpack.applications.rules.max_rules_per_ruleset
cluster setting.IMPORTANT: Due to limitations within pinned queries, you can only select documents using
ids
ordocs
, but cannot use both in single rule. It is advised to use one or the other in query rulesets, to avoid errors. Additionally, pinned queries have a maximum limit of 100 pinned hits. If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.- Parameters:
fn
- a function that initializes a builder to create thePutRulesetRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
test
Test a query ruleset. Evaluate match criteria against a query ruleset to identify the rules that would match that criteria.- Throws:
IOException
ElasticsearchException
- See Also:
-
test
public final TestResponse test(Function<TestRequest.Builder, ObjectBuilder<TestRequest>> fn) throws IOException, ElasticsearchExceptionTest a query ruleset. Evaluate match criteria against a query ruleset to identify the rules that would match that criteria.- Parameters:
fn
- a function that initializes a builder to create theTestRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-