Class ElasticsearchSynonymsClient
- All Implemented Interfaces:
- Closeable,- AutoCloseable
- 
Field SummaryFields inherited from class co.elastic.clients.ApiClienttransport, transportOptions
- 
Constructor SummaryConstructorsConstructorDescriptionElasticsearchSynonymsClient(ElasticsearchTransport transport, TransportOptions transportOptions) 
- 
Method SummaryModifier and TypeMethodDescriptiondeleteSynonym(DeleteSynonymRequest request) Delete a synonym set.final DeleteSynonymResponseDelete a synonym set.Delete a synonym rule.deleteSynonymRule(Function<DeleteSynonymRuleRequest.Builder, ObjectBuilder<DeleteSynonymRuleRequest>> fn) Delete a synonym rule.getSynonym(GetSynonymRequest request) Get a synonym set.final GetSynonymResponseGet a synonym set.getSynonymRule(GetSynonymRuleRequest request) Get a synonym rule.final GetSynonymRuleResponseGet a synonym rule.Get all synonym sets.getSynonymsSets(GetSynonymsSetsRequest request) Get all synonym sets.final GetSynonymsSetsResponseGet all synonym sets.putSynonym(PutSynonymRequest request) Create or update a synonym set.final PutSynonymResponseCreate or update a synonym set.putSynonymRule(PutSynonymRuleRequest request) Create or update a synonym rule.final PutSynonymRuleResponseCreate or update a synonym rule.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- 
ElasticsearchSynonymsClient
- 
ElasticsearchSynonymsClientpublic ElasticsearchSynonymsClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) 
 
- 
- 
Method Details- 
withTransportOptionspublic ElasticsearchSynonymsClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClientCreates a new client with some request options- Specified by:
- withTransportOptionsin class- ApiClient<ElasticsearchTransport,- ElasticsearchSynonymsClient> 
 
- 
deleteSynonympublic DeleteSynonymResponse deleteSynonym(DeleteSynonymRequest request) throws IOException, ElasticsearchException Delete a synonym set.You can only delete a synonyms set that is not in use by any index analyzer. Synonyms sets can be used in synonym graph token filters and synonym token filters. These synonym filters can be used as part of search analyzers. Analyzers need to be loaded when an index is restored (such as when a node starts, or the index becomes open). Even if the analyzer is not used on any field mapping, it still needs to be loaded on the index recovery phase. If any analyzers cannot be loaded, the index becomes unavailable and the cluster status becomes red or yellow as index shards are not available. To prevent that, synonyms sets that are used in analyzers can't be deleted. A delete request in this case will return a 400 response code. To remove a synonyms set, you must first remove all indices that contain analyzers using it. You can migrate an index by creating a new index that does not contain the token filter with the synonyms set, and use the reindex API in order to copy over the index data. Once finished, you can delete the index. When the synonyms set is not used in analyzers, you will be able to delete it. - Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
deleteSynonympublic final DeleteSynonymResponse deleteSynonym(Function<DeleteSynonymRequest.Builder, ObjectBuilder<DeleteSynonymRequest>> fn) throws IOException, ElasticsearchExceptionDelete a synonym set.You can only delete a synonyms set that is not in use by any index analyzer. Synonyms sets can be used in synonym graph token filters and synonym token filters. These synonym filters can be used as part of search analyzers. Analyzers need to be loaded when an index is restored (such as when a node starts, or the index becomes open). Even if the analyzer is not used on any field mapping, it still needs to be loaded on the index recovery phase. If any analyzers cannot be loaded, the index becomes unavailable and the cluster status becomes red or yellow as index shards are not available. To prevent that, synonyms sets that are used in analyzers can't be deleted. A delete request in this case will return a 400 response code. To remove a synonyms set, you must first remove all indices that contain analyzers using it. You can migrate an index by creating a new index that does not contain the token filter with the synonyms set, and use the reindex API in order to copy over the index data. Once finished, you can delete the index. When the synonyms set is not used in analyzers, you will be able to delete it. - Parameters:
- fn- a function that initializes a builder to create the- DeleteSynonymRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
deleteSynonymRulepublic DeleteSynonymRuleResponse deleteSynonymRule(DeleteSynonymRuleRequest request) throws IOException, ElasticsearchException Delete a synonym rule. Delete a synonym rule from a synonym set.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
deleteSynonymRulepublic final DeleteSynonymRuleResponse deleteSynonymRule(Function<DeleteSynonymRuleRequest.Builder, ObjectBuilder<DeleteSynonymRuleRequest>> fn) throws IOException, ElasticsearchExceptionDelete a synonym rule. Delete a synonym rule from a synonym set.- Parameters:
- fn- a function that initializes a builder to create the- DeleteSynonymRuleRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getSynonympublic GetSynonymResponse getSynonym(GetSynonymRequest request) throws IOException, ElasticsearchException Get a synonym set.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getSynonympublic final GetSynonymResponse getSynonym(Function<GetSynonymRequest.Builder, ObjectBuilder<GetSynonymRequest>> fn) throws IOException, ElasticsearchExceptionGet a synonym set.- Parameters:
- fn- a function that initializes a builder to create the- GetSynonymRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getSynonymRulepublic GetSynonymRuleResponse getSynonymRule(GetSynonymRuleRequest request) throws IOException, ElasticsearchException Get a synonym rule. Get a synonym rule from a synonym set.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getSynonymRulepublic final GetSynonymRuleResponse getSynonymRule(Function<GetSynonymRuleRequest.Builder, ObjectBuilder<GetSynonymRuleRequest>> fn) throws IOException, ElasticsearchExceptionGet a synonym rule. Get a synonym rule from a synonym set.- Parameters:
- fn- a function that initializes a builder to create the- GetSynonymRuleRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getSynonymsSetspublic GetSynonymsSetsResponse getSynonymsSets(GetSynonymsSetsRequest request) throws IOException, ElasticsearchException Get all synonym sets. Get a summary of all defined synonym sets.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getSynonymsSetspublic final GetSynonymsSetsResponse getSynonymsSets(Function<GetSynonymsSetsRequest.Builder, ObjectBuilder<GetSynonymsSetsRequest>> fn) throws IOException, ElasticsearchExceptionGet all synonym sets. Get a summary of all defined synonym sets.- Parameters:
- fn- a function that initializes a builder to create the- GetSynonymsSetsRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getSynonymsSetsGet all synonym sets. Get a summary of all defined synonym sets.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
putSynonympublic PutSynonymResponse putSynonym(PutSynonymRequest request) throws IOException, ElasticsearchException Create or update a synonym set. Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If you need to manage more synonym rules, you can create multiple synonym sets.When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices. This is equivalent to invoking the reload search analyzers API for all indices that use the synonyms set. For practical examples of how to create or update a synonyms set, refer to the External documentation. - Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
putSynonympublic final PutSynonymResponse putSynonym(Function<PutSynonymRequest.Builder, ObjectBuilder<PutSynonymRequest>> fn) throws IOException, ElasticsearchExceptionCreate or update a synonym set. Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If you need to manage more synonym rules, you can create multiple synonym sets.When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices. This is equivalent to invoking the reload search analyzers API for all indices that use the synonyms set. For practical examples of how to create or update a synonyms set, refer to the External documentation. - Parameters:
- fn- a function that initializes a builder to create the- PutSynonymRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
putSynonymRulepublic PutSynonymRuleResponse putSynonymRule(PutSynonymRuleRequest request) throws IOException, ElasticsearchException Create or update a synonym rule. Create or update a synonym rule in a synonym set.If any of the synonym rules included is invalid, the API returns an error. When you update a synonym rule, all analyzers using the synonyms set will be reloaded automatically to reflect the new rule. - Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
putSynonymRulepublic final PutSynonymRuleResponse putSynonymRule(Function<PutSynonymRuleRequest.Builder, ObjectBuilder<PutSynonymRuleRequest>> fn) throws IOException, ElasticsearchExceptionCreate or update a synonym rule. Create or update a synonym rule in a synonym set.If any of the synonym rules included is invalid, the API returns an error. When you update a synonym rule, all analyzers using the synonyms set will be reloaded automatically to reflect the new rule. - Parameters:
- fn- a function that initializes a builder to create the- PutSynonymRuleRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
 
-