Class DefaultCustomSearchIndexRegistry
java.lang.Object
com.atlassian.confluence.internal.index.lucene.DefaultCustomSearchIndexRegistry
- All Implemented Interfaces:
CustomSearchIndexRegistry
- Since:
- 7.17
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCustomSearchIndexRegistry
(LuceneFieldVisitor luceneFieldVisitor, LuceneSearchMapper luceneSearchMapper, CustomLuceneConnectionFactory customLuceneConnectionFactory, Supplier<FieldMappings> fieldMappingsProvider) -
Method Summary
Modifier and TypeMethodDescriptionadd
(String name, AnalyzerDescriptorProvider analyzerDescriptorProvider) This method can be called multiple times but a newSearchIndexAccessor
instance will be created only once for the first call.void
destroy()
This method returns theSearchIndexAccessor
corresponding to the index represented by its unique name.void
Remove the custom index from the registry.
-
Constructor Details
-
DefaultCustomSearchIndexRegistry
public DefaultCustomSearchIndexRegistry(LuceneFieldVisitor luceneFieldVisitor, LuceneSearchMapper luceneSearchMapper, CustomLuceneConnectionFactory customLuceneConnectionFactory, Supplier<FieldMappings> fieldMappingsProvider)
-
-
Method Details
-
add
public SearchIndexAccessor add(String name, AnalyzerDescriptorProvider analyzerDescriptorProvider) throws SearchIndexAccessException Description copied from interface:CustomSearchIndexRegistry
This method can be called multiple times but a newSearchIndexAccessor
instance 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
name
is prefixed with the plugin key to avoid naming conflicts and/or unintentionally sharing indexes with another plugin.- Specified by:
add
in 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 aMappingAnalyzerDescriptor
representing a Lucene Analyzer, or null ifKeywordAnalyzer
is used.- Returns:
- a
SearchIndexAccessor
that can access to this custom index. - Throws:
SearchIndexAccessException
-
get
Description copied from interface:CustomSearchIndexRegistry
This method returns theSearchIndexAccessor
corresponding to the index represented by its unique name.- Specified by:
get
in interfaceCustomSearchIndexRegistry
- Parameters:
name
- the name of the custom index- Returns:
- a
SearchIndexAccessor
that can access to this custom index - Throws:
SearchIndexAccessException
- if the custom search index does not exist
-
remove
Description copied from interface:CustomSearchIndexRegistry
Remove the custom index from the registry. The internal lucene connection will be also closed.- Specified by:
remove
in interfaceCustomSearchIndexRegistry
- Parameters:
name
- the name of the custom index- Throws:
SearchIndexAccessException
- if the custom search index does not exist
-
destroy
public void destroy()
-