Class ElasticsearchIndexManager
java.lang.Object
io.jmix.search.index.impl.BaseIndexManager<co.elastic.clients.elasticsearch.indices.IndexState,co.elastic.clients.elasticsearch.indices.IndexSettings,co.elastic.clients.json.JsonpSerializable>
io.jmix.searchelasticsearch.index.impl.ElasticsearchIndexManager
- All Implemented Interfaces:
IndexManager
public class ElasticsearchIndexManager
extends BaseIndexManager<co.elastic.clients.elasticsearch.indices.IndexState,co.elastic.clients.elasticsearch.indices.IndexSettings,co.elastic.clients.json.JsonpSerializable>
Implementation for Elasticsearch
-
Field Summary
Modifier and TypeFieldDescriptionprotected final co.elastic.clients.elasticsearch.ElasticsearchClient
protected final ElasticsearchIndexSettingsProvider
protected final ElasticsearchPutMappingRequestBuilder
Fields inherited from class io.jmix.search.index.impl.BaseIndexManager
indexConfigurationComparator, indexConfigurationManager, indexStateRegistry, indexStateResolver, objectMapper, searchProperties
-
Constructor Summary
ConstructorDescriptionElasticsearchIndexManager
(co.elastic.clients.elasticsearch.ElasticsearchClient client, IndexStateRegistry indexStateRegistry, IndexConfigurationManager indexConfigurationManager, SearchProperties searchProperties, ElasticsearchIndexSettingsProvider indexSettingsProcessor, ElasticsearchIndexConfigurationComparator configurationComparator, ElasticsearchIndexStateResolver indexStateResolver, ElasticsearchPutMappingRequestBuilder putMappingRequestBuilder) -
Method Summary
Modifier and TypeMethodDescriptionprotected co.elastic.clients.elasticsearch._types.mapping.TypeMapping
buildMapping
(IndexConfiguration indexConfiguration) protected co.elastic.clients.elasticsearch.indices.IndexSettings
buildSettings
(IndexConfiguration indexConfiguration) boolean
createIndex
(IndexConfiguration indexConfiguration) Creates index if not exists using providedIndexConfiguration
.boolean
Drops index by name.com.fasterxml.jackson.databind.node.ObjectNode
getIndexMetadata
(String indexName) Requests info about index from server.boolean
isIndexExist
(String indexName) Checks if index exists.boolean
putMapping
(String indexName, IndexMappingConfiguration mapping) Saves mapping to index on the search server or servers cluster.Methods inherited from class io.jmix.search.index.impl.BaseIndexManager
handleMissingIndex, recreateIndex, recreateIndexes, recreateIndexes, recreateIrrelevantIndex, synchronizeIndexSchema, synchronizeIndexSchema, synchronizeIndexSchemas, synchronizeIndexSchemas, updateIndexConfiguration, validateIndex, validateIndexes, validateIndexes
-
Field Details
-
client
protected final co.elastic.clients.elasticsearch.ElasticsearchClient client -
indexSettingsProcessor
-
putMappingRequestBuilder
-
-
Constructor Details
-
ElasticsearchIndexManager
public ElasticsearchIndexManager(co.elastic.clients.elasticsearch.ElasticsearchClient client, IndexStateRegistry indexStateRegistry, IndexConfigurationManager indexConfigurationManager, SearchProperties searchProperties, ElasticsearchIndexSettingsProvider indexSettingsProcessor, ElasticsearchIndexConfigurationComparator configurationComparator, ElasticsearchIndexStateResolver indexStateResolver, ElasticsearchPutMappingRequestBuilder putMappingRequestBuilder)
-
-
Method Details
-
createIndex
Description copied from interface:IndexManager
Creates index if not exists using providedIndexConfiguration
.- Parameters:
indexConfiguration
- index configuration- Returns:
- true if index was successfully created, false otherwise
-
dropIndex
Description copied from interface:IndexManager
Drops index by name.- Parameters:
indexName
- index name- Returns:
- true if index was successfully dropped, false otherwise
-
isIndexExist
Description copied from interface:IndexManager
Checks if index exists.- Parameters:
indexName
- index name- Returns:
- true if index exists, false otherwise
-
getIndexMetadata
Description copied from interface:IndexManager
Requests info about index from server.- Parameters:
indexName
- index name- Returns:
- response as Json
-
putMapping
Description copied from interface:IndexManager
Saves mapping to index on the search server or servers cluster.- Parameters:
indexName
- name of the index for saving mappingmapping
- mapping for saving to configuration of the specified index- Returns:
- true if saving process was performed successfully.
-
buildMapping
protected co.elastic.clients.elasticsearch._types.mapping.TypeMapping buildMapping(IndexConfiguration indexConfiguration) -
buildSettings
protected co.elastic.clients.elasticsearch.indices.IndexSettings buildSettings(IndexConfiguration indexConfiguration)
-