Class OpenSearchCustomSearchIndexRegistry
java.lang.Object
com.atlassian.confluence.plugins.opensearch.OpenSearchCustomSearchIndexRegistry
- All Implemented Interfaces:
CustomSearchIndexRegistry
public class OpenSearchCustomSearchIndexRegistry
extends Object
implements CustomSearchIndexRegistry
- Since:
- 8.6
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSearchCustomSearchIndexRegistry(OpenSearchSearchIndexAccessorFactory openSearchSearchIndexAccessorFactory, OpenSearchIndexManagerFactory indexManagerFactory) -
Method Summary
Modifier and TypeMethodDescriptionadd(String name, @Nullable AnalyzerDescriptorProvider analyzerDescriptorProvider) This method can be called multiple times but a newSearchIndexAccessorinstance will be created only once for the first call.This method returns theSearchIndexAccessorcorresponding to the index represented by its unique name.voidRemove the custom index from the registry.
-
Constructor Details
-
OpenSearchCustomSearchIndexRegistry
public OpenSearchCustomSearchIndexRegistry(OpenSearchSearchIndexAccessorFactory openSearchSearchIndexAccessorFactory, OpenSearchIndexManagerFactory indexManagerFactory)
-
-
Method Details
-
add
public SearchIndexAccessor add(String name, @Nullable AnalyzerDescriptorProvider analyzerDescriptorProvider) throws SearchIndexAccessException Description copied from interface:CustomSearchIndexRegistryThis method can be called multiple times but a newSearchIndexAccessorinstance will be created only once for the first call. The same instance will be returned by subsequent calls to the method with the same name.It is highly recommended that the
nameis prefixed with the plugin key to avoid naming conflicts and/or unintentionally sharing indexes with another plugin.- Specified by:
addin interfaceCustomSearchIndexRegistry- Parameters:
name- the unique name of the custom index. The name should have a plugin key as its prefix to avoid naming conflicts.analyzerDescriptorProvider- provider for aMappingAnalyzerDescriptorrepresenting a Lucene Analyzer, or null ifKeywordAnalyzeris used.- Returns:
- a
SearchIndexAccessorthat can access to this custom index. - Throws:
SearchIndexAccessException
-
get
Description copied from interface:CustomSearchIndexRegistryThis method returns theSearchIndexAccessorcorresponding to the index represented by its unique name.- Specified by:
getin interfaceCustomSearchIndexRegistry- Parameters:
name- the name of the custom index- Returns:
- a
SearchIndexAccessorthat can access to this custom index - Throws:
SearchIndexAccessException- if the custom search index does not exist
-
remove
Description copied from interface:CustomSearchIndexRegistryRemove the custom index from the registry. The internal lucene connection will be also closed.- Specified by:
removein interfaceCustomSearchIndexRegistry- Parameters:
name- the name of the custom index- Throws:
SearchIndexAccessException- if the custom search index does not exist
-