public class DefaultCustomSearchIndexRegistry extends Object implements CustomSearchIndexRegistry
| Constructor and Description |
|---|
DefaultCustomSearchIndexRegistry(LuceneFieldVisitor luceneFieldVisitor,
LuceneSearchMapper luceneSearchMapper,
CustomLuceneConnectionFactory customLuceneConnectionFactory) |
| Modifier and Type | Method and Description |
|---|---|
SearchIndexAccessor |
add(String name,
String relativeIndexPath,
ScoringStrategy scoringStrategy,
AnalyzerDescriptorProvider analyzerDescriptorProvider)
This method can be called multiple times but a new
SearchIndexAccessor instance will be created only once
for the first call. |
void |
destroy() |
SearchIndexAccessor |
get(String name)
This method returns the
SearchIndexAccessor corresponding to the index represented by its unique name. |
void |
remove(String name)
Remove the custom index from the registry.
|
public DefaultCustomSearchIndexRegistry(LuceneFieldVisitor luceneFieldVisitor, LuceneSearchMapper luceneSearchMapper, CustomLuceneConnectionFactory customLuceneConnectionFactory)
public SearchIndexAccessor add(String name, String relativeIndexPath, ScoringStrategy scoringStrategy, AnalyzerDescriptorProvider analyzerDescriptorProvider) throws SearchIndexAccessException
CustomSearchIndexRegistrySearchIndexAccessor 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 prefix name and relativeIndexPath are prefixed with
the plugin key to avoid naming conflicts and/or unintentionally sharing indexes with another plugin.
add in interface CustomSearchIndexRegistryname - the unique name of the custom index. The name should have a plugin key as its prefix
to avoid naming conflicts. If the custom index directory is not created, it will be created under the default index directory.relativeIndexPath - the path relative to the confluence lucene index directory expressed as a String. You must use forward slashes as seperators i.e plugin/usage. Underlying impl is filesystem independent.scoringStrategy - the scoring strategy that will be used to scan the documents.analyzerDescriptorProvider - provider for a MappingAnalyzerDescriptor representing a Lucene Analyzer, or null if KeywordAnalyzer is used.SearchIndexAccessor that can access to this custom index.SearchIndexAccessExceptionpublic SearchIndexAccessor get(String name) throws SearchIndexAccessException
CustomSearchIndexRegistrySearchIndexAccessor corresponding to the index represented by its unique name.get in interface CustomSearchIndexRegistryname - the name of the custom indexSearchIndexAccessor that can access to this custom indexSearchIndexAccessException - if the custom search index does not existpublic void remove(String name) throws SearchIndexAccessException
CustomSearchIndexRegistryremove in interface CustomSearchIndexRegistryname - the name of the custom indexSearchIndexAccessException - if the custom search index does not existpublic void destroy()
Copyright © 2003–2022 Atlassian. All rights reserved.