Class DefaultCustomSearchIndexRegistry
- java.lang.Object
-
- com.atlassian.confluence.internal.index.lucene.DefaultCustomSearchIndexRegistry
-
- All Implemented Interfaces:
CustomSearchIndexRegistry
public class DefaultCustomSearchIndexRegistry extends Object implements CustomSearchIndexRegistry
- Since:
- 7.17
-
-
Constructor Summary
Constructors Constructor Description DefaultCustomSearchIndexRegistry(LuceneFieldVisitor luceneFieldVisitor, LuceneSearchMapper luceneSearchMapper, CustomLuceneConnectionFactory customLuceneConnectionFactory, javax.inject.Provider<FieldMappings> fieldMappingsProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchIndexAccessoradd(String name, String relativeIndexPath, ScoringStrategy scoringStrategy, AnalyzerDescriptorProvider analyzerDescriptorProvider)This method can be called multiple times but a newSearchIndexAccessorinstance will be created only once for the first call.voiddestroy()SearchIndexAccessorget(String name)This method returns theSearchIndexAccessorcorresponding to the index represented by its unique name.voidremove(String name)Remove the custom index from the registry.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.search.v2.CustomSearchIndexRegistry
add
-
-
-
-
Constructor Detail
-
DefaultCustomSearchIndexRegistry
public DefaultCustomSearchIndexRegistry(LuceneFieldVisitor luceneFieldVisitor, LuceneSearchMapper luceneSearchMapper, CustomLuceneConnectionFactory customLuceneConnectionFactory, javax.inject.Provider<FieldMappings> fieldMappingsProvider)
-
-
Method Detail
-
add
public SearchIndexAccessor add(String name, String relativeIndexPath, ScoringStrategy scoringStrategy, 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 prefix
nameandrelativeIndexPathare 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. 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 separators i.e. plugin/usage. Underlying impl is filesystem independent.scoringStrategy- the scoring strategy that will be used to scan the documents.analyzerDescriptorProvider- provider for aMappingAnalyzerDescriptorrepresenting a Lucene Analyzer, or null ifKeywordAnalyzeris used.- Returns:
- a
SearchIndexAccessorthat can access to this custom index. - Throws:
SearchIndexAccessException
-
get
public SearchIndexAccessor get(String name) throws SearchIndexAccessException
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
public void remove(String name) throws SearchIndexAccessException
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
-
destroy
public void destroy()
-
-