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 DeleteRuleResponseDelete a query rule.deleteRuleset(DeleteRulesetRequest request) Delete a query ruleset.final DeleteRulesetResponseDelete a query ruleset.getRule(GetRuleRequest request) Get a query rule.final GetRuleResponseGet a query rule.getRuleset(GetRulesetRequest request) Get a query ruleset.final GetRulesetResponseGet a query ruleset.Get all query rulesets.listRulesets(ListRulesetsRequest request) Get all query rulesets.final ListRulesetsResponseGet all query rulesets.putRule(PutRuleRequest request) Create or update a query rule.final PutRuleResponseCreate or update a query rule.putRuleset(PutRulesetRequest request) Create or update a query ruleset.final PutRulesetResponseCreate or update a query ruleset.test(TestRequest request) Test a query ruleset.final TestResponseTest 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:ApiClientCreates a new client with some request options- Specified by:
withTransportOptionsin 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:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- See Also:
-
getRule
Get a query rule. Get details about a query rule within a query ruleset.- Throws:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- See Also:
-
getRuleset
public GetRulesetResponse getRuleset(GetRulesetRequest request) throws IOException, ElasticsearchException Get a query ruleset. Get details about a query ruleset.- Throws:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- See Also:
-
listRulesets
public ListRulesetsResponse listRulesets(ListRulesetsRequest request) throws IOException, ElasticsearchException Get all query rulesets. Get summarized information about the query rulesets.- Throws:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- See Also:
-
listRulesets
Get all query rulesets. Get summarized information about the query rulesets.- Throws:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- 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_rulesetcluster setting.IMPORTANT: Due to limitations within pinned queries, you can only select documents using
idsordocs, 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:
IOExceptionElasticsearchException- 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_rulesetcluster setting.IMPORTANT: Due to limitations within pinned queries, you can only select documents using
idsordocs, 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:
IOExceptionElasticsearchException- See Also:
-
test
Test a query ruleset. Evaluate match criteria against a query ruleset to identify the rules that would match that criteria.- Throws:
IOExceptionElasticsearchException- 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:
IOExceptionElasticsearchException- See Also:
-