public class DefaultIndexManager extends Object implements IssueIndexManager
| Modifier and Type | Field and Description |
|---|---|
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_INDEXING |
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_SEARCHING |
| Constructor and Description |
|---|
DefaultIndexManager(IndexingConfiguration indexProperties,
IssueIndexer issueIndexer,
IndexPathManager indexPath,
ReindexMessageManager reindexMessageManager,
com.atlassian.event.api.EventPublisher eventPublisher,
ListenerManager listenerManager,
ProjectManager projectManager,
IssueManager issueManager,
TaskManager taskManager,
OfBizDelegator ofBizDelegator,
ReplicatedIndexManager replicatedIndexManager,
IssueSearcherFactory issueSearcherFactory,
TimeTrackingConfiguration timeTrackingConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
long |
activate(Context context)
Activates search indexes.
|
long |
activate(Context context,
boolean reindex)
Activates search indexes.
|
void |
closeQuietly(org.apache.lucene.search.IndexSearcher issueSearcher) |
void |
deactivate()
De-activates indexing (as happens from the admin page) and removes index directories.
|
void |
deIndex(org.ofbiz.core.entity.GenericValue entity)
Remove an issue from the search index.
|
void |
deIndex(Issue issue)
Remove an issue from the search index.
|
void |
deIndexIssueObjects(Set<Issue> issuesToDelete,
boolean updateReplicatedIndexStore)
Remove a set of issues from the search index.
|
static void |
flushThreadLocalSearchers() |
Collection<String> |
getAllIndexPaths() |
org.apache.lucene.analysis.Analyzer |
getAnalyzerForIndexing()
Returns an
Analyzer for indexing. |
org.apache.lucene.analysis.Analyzer |
getAnalyzerForSearching()
Returns an
Analyzer for searching. |
org.apache.lucene.search.IndexSearcher |
getChangeHistorySearcher()
Get an
IndexSearcher that can be used to search the change history index. |
org.apache.lucene.search.IndexSearcher |
getCommentSearcher()
Get an
IndexSearcher that can be used to search the comment index. |
List<String> |
getExistingPluginsPaths()
Returns a collection of Strings, each one representing the absolute path to the actual existing directory
where a plugin keeps its indexes.
|
org.apache.lucene.search.IndexSearcher |
getIssueSearcher()
Get an
IndexSearcher that can be used to search the issue index. |
String |
getPluginsRootPath()
Get the root path of the index directory for plugins.
|
org.apache.lucene.search.IndexSearcher |
getWorklogSearcher()
Get an
IndexSearcher that can be used to search the worklog index. |
void |
hold()
Temporarily suspend indexing on this thread.
|
boolean |
isEmpty() |
boolean |
isHeld()
Return true if the index is held.
|
boolean |
isIndexAvailable()
Whether this index is available.
|
boolean |
isIndexConsistent() |
boolean |
isIndexingEnabled() |
long |
optimize()
Optimize the underlying indexes.
|
void |
reIndex(org.ofbiz.core.entity.GenericValue issueGV)
Reindex an issue (eg.
|
void |
reIndex(Issue issue)
Reindex an issue (eg.
|
void |
reIndex(Issue issue,
boolean reIndexComments,
boolean reIndexChangeHistory)
Reindex an issue (eg.
|
void |
reIndex(Issue issue,
IssueIndexingParams issueIndexingParams)
Reindex an issue (eg.
|
long |
reIndexAll()
Reindex all issues.
|
long |
reIndexAll(Context context)
Reindex everything.
|
long |
reIndexAll(Context context,
boolean useBackgroundIndexing) |
long |
reIndexAll(Context context,
boolean useBackgroundIndexing,
boolean updateReplicatedIndex)
Reindex all issues.
|
long |
reIndexAll(Context context,
boolean useBackgroundIndexing,
boolean reIndexComments,
boolean reIndexChangeHistory,
boolean updateReplicatedIndex)
Reindex all issues.
|
long |
reIndexAll(Context context,
boolean useBackgroundIndexing,
IssueIndexingParams issueIndexingParams,
boolean updateReplicatedIndex)
Reindex all issues.
|
long |
reIndexAll(Context context,
IssueIndexingParams issueIndexingParams)
Reindex indexes defined by the
IssueIndexingParams. |
long |
reIndexAllIssuesInBackground(Context context)
Reindex everything, but don't stop the world
Comments and change history will not be reindexed.
|
long |
reIndexAllIssuesInBackground(Context context,
boolean reIndexComments,
boolean reIndexChangeHistory)
Reindex everything, but don't stop the world
|
long |
reIndexComments(Collection<Comment> comments)
Reindexes a collection of comments.
|
long |
reIndexComments(Collection<Comment> comments,
Context context)
Reindexes a collection of comments.
|
long |
reIndexComments(Collection<Comment> comments,
Context context,
boolean updateReplicatedIndexStore)
Reindexes a collection of comments.
|
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects)
Reindex a set of issues.
|
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
boolean reIndexComments,
boolean reIndexChangeHistory)
Reindex a set of issues.
|
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
boolean reIndexComments,
boolean reIndexChangeHistory,
boolean updateReplicatedIndexStore)
Reindex a set of issues.
|
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
IssueIndexingParams issueIndexingParams)
Reindex a set of issues.
|
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
IssueIndexingParams issueIndexingParams,
boolean updateReplicatedIndexStore)
Reindex a set of issues.
|
long |
reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues)
Reindex a set of issues (GenericValues).
|
protected long |
reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues,
IssueIndexingParams issueIndexingParams) |
long |
reIndexIssues(IssuesIterable issuesIterable,
Context context)
Reindex a list of issues, passing an optional event that will be set progress
|
long |
reIndexIssues(IssuesIterable issuesIterable,
Context context,
boolean reIndexComments,
boolean reIndexChangeHistory)
Reindex a list of issues, passing an optional event that will be set progress.
|
long |
reIndexIssues(IssuesIterable issuesIterable,
Context context,
IssueIndexingParams issueIndexingParams)
Reindex a list of issues, passing an optional event that will be set progress.
|
long |
reIndexIssuesInBackground(Context context,
IssueIndexingParams issueIndexingParams)
Reindex everything, but don't stop the world
|
long |
reIndexWorklogs(Collection<Worklog> worklogs)
Reindexes a collection of worklogs.
|
long |
reIndexWorklogs(Collection<Worklog> worklogs,
Context context)
Reindexes a collection of worklogs.
|
long |
reIndexWorklogs(Collection<Worklog> worklogs,
Context context,
boolean updateReplicatedIndexStore)
Reindexes a collection of worklogs.
|
long |
release()
Release indexing on this thread.
|
void |
shutdown()
Shuts down the indexing manager and closes its resources (if any).
|
int |
size() |
String |
toString() |
boolean |
withReindexLock(Runnable runnable)
This method takes a runnable that is run under the 'stop the world' reindex lock.
|
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_SEARCHING
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_INDEXING
public DefaultIndexManager(IndexingConfiguration indexProperties, IssueIndexer issueIndexer, IndexPathManager indexPath, ReindexMessageManager reindexMessageManager, com.atlassian.event.api.EventPublisher eventPublisher, ListenerManager listenerManager, ProjectManager projectManager, IssueManager issueManager, TaskManager taskManager, OfBizDelegator ofBizDelegator, ReplicatedIndexManager replicatedIndexManager, IssueSearcherFactory issueSearcherFactory, TimeTrackingConfiguration timeTrackingConfiguration)
public org.apache.lucene.analysis.Analyzer getAnalyzerForSearching()
IssueIndexManagerAnalyzer for searching.getAnalyzerForSearching in interface IssueIndexManagerpublic org.apache.lucene.analysis.Analyzer getAnalyzerForIndexing()
IssueIndexManagerAnalyzer for indexing.getAnalyzerForIndexing in interface IssueIndexManagerpublic void deactivate()
IndexLifecycleManagerdeactivate in interface IndexLifecycleManagerpublic long activate(Context context)
IndexLifecycleManageractivate in interface IndexLifecycleManagercontext - used to report progress back to the user or to the logs. Must not be null.public long activate(Context context, boolean reindex)
IndexLifecycleManageractivate in interface IndexLifecycleManagercontext - used to report progress back to the user or to the logs. Must not be null.reindex - reindex after activation.public boolean isIndexingEnabled()
isIndexingEnabled in interface IndexLifecycleManagerpublic boolean isIndexAvailable()
IndexLifecycleManagerisIndexAvailable in interface IndexLifecycleManagerpublic long reIndexAll()
throws IndexException
IssueIndexManagerreIndexAll in interface IssueIndexingServicereIndexAll in interface IssueIndexManagerIndexExceptionpublic long reIndexAll(Context context)
IndexLifecycleManagerreIndexAll in interface IndexLifecycleManagercontext - used to report progress back to the user or to the logs. Must not be null.public long reIndexAll(Context context, boolean useBackgroundIndexing)
public long reIndexAll(Context context, boolean useBackgroundIndexing, boolean updateReplicatedIndex)
IssueIndexManagerreIndexAll in interface IssueIndexingServicereIndexAll in interface IssueIndexManagercontext - used to report progress back to the user or to the logs. Must not be nulluseBackgroundIndexing - whether to index in the background or not. If the useBackgroundReindexing option
is set to true, then all related fields will not be reindexed.updateReplicatedIndex - whether to update the replicated index or notpublic long reIndexAll(Context context, boolean useBackgroundIndexing, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndex)
IssueIndexManagerreIndexAll in interface IssueIndexManagercontext - used to report progress back to the user or to the logs. Must not be nulluseBackgroundIndexing - whether to index in the background or notreIndexComments - Also reindex all the issue comments. Only relevant for background reindex operations.reIndexChangeHistory - Also reindex the issue change history. Only relevant for background reindex
operations.updateReplicatedIndex - whether to update the replicated index or notpublic long reIndexAll(Context context, IssueIndexingParams issueIndexingParams)
IndexLifecycleManagerIssueIndexingParams.reIndexAll in interface IndexLifecycleManagercontext - used to report progress back to the user or to the logs. Must not be null.issueIndexingParams - indexes to reindex.public long reIndexAll(Context context, boolean useBackgroundIndexing, IssueIndexingParams issueIndexingParams, boolean updateReplicatedIndex)
IssueIndexManagerreIndexAll in interface IssueIndexingServicereIndexAll in interface IssueIndexManagercontext - used to report progress back to the user or to the logs. Must not be nulluseBackgroundIndexing - whether to index in the background or notissueIndexingParams - determines witch related objects should be indexed together with issues. Only relevant
for background reindex operations.updateReplicatedIndex - whether to update the replicated index or notpublic boolean withReindexLock(Runnable runnable)
withReindexLock in interface IssueIndexManagerrunnable - The runnable to be executedpublic long reIndexAllIssuesInBackground(Context context)
IndexLifecycleManagerreIndexAllIssuesInBackground in interface IndexLifecycleManagercontext - used to report progress back to the user or to the logs. Must not be null.public long reIndexAllIssuesInBackground(Context context, boolean reIndexComments, boolean reIndexChangeHistory)
IndexLifecycleManagerreIndexAllIssuesInBackground in interface IndexLifecycleManagercontext - used to report progress back to the user or to the logs. Must not be null.reIndexComments - Also reindex all the issue comments.reIndexChangeHistory - Also reindex the issue change history.public long reIndexIssuesInBackground(Context context, IssueIndexingParams issueIndexingParams)
IndexLifecycleManagerreIndexIssuesInBackground in interface IndexLifecycleManagercontext - used to report progress back to the user or to the logs. Must not be null.issueIndexingParams - determines witch related objects should be indexed together with issue.public long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues) throws IndexException
IssueIndexManagerIssueIndexManager.reIndexIssueObjects(Collection) instead when possible.reIndexIssues in interface IssueIndexManagerissues - The Issue GenericValues to reindex.IndexExceptionprotected long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues, IssueIndexingParams issueIndexingParams) throws IndexException
IndexExceptionpublic long reIndexIssueObjects(Collection<? extends Issue> issueObjects) throws IndexException
IssueIndexManagerreIndexIssueObjects in interface IssueIndexingServicereIndexIssueObjects in interface IssueIndexManagerissueObjects - Set of Issues to reindex.IndexExceptionpublic long reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
IssueIndexManagerreIndexIssueObjects in interface IssueIndexManagerissueObjects - Set of Issues to reindex.IndexExceptionpublic long reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams) throws IndexException
IssueIndexManagerreIndexIssueObjects in interface IssueIndexingServicereIndexIssueObjects in interface IssueIndexManagerissueObjects - Set of Issues to reindex.issueIndexingParams - Determines witch related objects should be indexed together with issues.IndexExceptionpublic long reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndexStore) throws IndexException
IssueIndexManagerreIndexIssueObjects in interface IssueIndexManagerissueObjects - Set of Issues to reindex.reIndexComments - whether to reindex the comments or notreIndexChangeHistory - whether to reindex changeHistory or notupdateReplicatedIndexStore - whether to store index operations in the replicated index storeIndexExceptionpublic long reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams, boolean updateReplicatedIndexStore) throws IndexException
IssueIndexManagerreIndexIssueObjects in interface IssueIndexingServicereIndexIssueObjects in interface IssueIndexManagerissueObjects - Set of Issues to reindex.issueIndexingParams - Determines witch related objects should be indexed together with issues.updateReplicatedIndexStore - whether to store index operations in the replicated index storeIndexExceptionpublic void reIndex(Issue issue) throws IndexException
IssueIndexManagerreIndex in interface IssueIndexingServicereIndex in interface IssueIndexManagerIndexExceptionpublic void reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
IssueIndexManagerreIndex in interface IssueIndexManagerIndexExceptionpublic void reIndex(Issue issue, IssueIndexingParams issueIndexingParams) throws IndexException
IssueIndexManagerreIndex in interface IssueIndexingServicereIndex in interface IssueIndexManagerIndexExceptionpublic void reIndex(org.ofbiz.core.entity.GenericValue issueGV)
throws IndexException
IssueIndexManagerreIndex in interface IssueIndexManagerIndexExceptionpublic void hold()
IssueIndexManagerhold in interface IssueIndexManagerpublic boolean isHeld()
IssueIndexManagerisHeld in interface IssueIndexManagerpublic long release()
throws IndexException
IssueIndexManagerrelease in interface IssueIndexManagerIndexException - if an error occurspublic long reIndexIssues(IssuesIterable issuesIterable, Context context) throws IndexException
IssueIndexManagerreIndexIssues in interface IssueIndexingServicereIndexIssues in interface IssueIndexManagerissuesIterable - IssuesIterablecontext - used to report progress back to the user or to the logs. Must not be null.IndexExceptionpublic long reIndexIssues(IssuesIterable issuesIterable, Context context, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
IssueIndexManagerreIndexIssues in interface IssueIndexManagerissuesIterable - IssuesIterablecontext - used to report progress back to the user or to the logs. Must not be null.reIndexComments - a boolean indicating whether to index issue commentsreIndexChangeHistory - a boolean indicating whether to index issue change historyIndexExceptionpublic long reIndexIssues(IssuesIterable issuesIterable, Context context, IssueIndexingParams issueIndexingParams) throws IndexException
IssueIndexManagerreIndexIssues in interface IssueIndexingServicereIndexIssues in interface IssueIndexManagerissuesIterable - IssuesIterablecontext - used to report progress back to the user or to the logs. Must not be null.issueIndexingParams - determines witch related objects should be indexed together with issue.IndexExceptionpublic long reIndexComments(Collection<Comment> comments) throws IndexException
IssueIndexManagerreIndexComments in interface IssueIndexingServicereIndexComments in interface IssueIndexManagercomments - a collection of CommentIndexExceptionpublic long reIndexComments(Collection<Comment> comments, Context context) throws IndexException
IssueIndexManagerreIndexComments in interface IssueIndexingServicereIndexComments in interface IssueIndexManagercomments - a collection of Commentcontext - used to report progress back to the user or to the logs. Must not be null.IndexExceptionpublic long reIndexComments(Collection<Comment> comments, Context context, boolean updateReplicatedIndexStore) throws IndexException
IssueIndexManagerreIndexComments in interface IssueIndexingServicereIndexComments in interface IssueIndexManagercomments - a collection of Commentcontext - used to report progress back to the user or to the logs. Must not be null.updateReplicatedIndexStore - whether to update the replicated index or notIndexExceptionpublic long reIndexWorklogs(Collection<Worklog> worklogs) throws IndexException
IssueIndexManagerreIndexWorklogs in interface IssueIndexingServicereIndexWorklogs in interface IssueIndexManagerworklogs - a collection of WorklogsIndexExceptionpublic long reIndexWorklogs(Collection<Worklog> worklogs, Context context) throws IndexException
IssueIndexManagerreIndexWorklogs in interface IssueIndexingServicereIndexWorklogs in interface IssueIndexManagerworklogs - a collection of Worklogscontext - used to report progress back to the user or to the logs. Must not be null.IndexExceptionpublic long reIndexWorklogs(Collection<Worklog> worklogs, Context context, boolean updateReplicatedIndexStore) throws IndexException
IssueIndexManagerreIndexWorklogs in interface IssueIndexingServicereIndexWorklogs in interface IssueIndexManagerworklogs - a collection of Worklogscontext - used to report progress back to the user or to the logs. Must not be null.updateReplicatedIndexStore - whether to update the replicated index or notIndexExceptionpublic boolean isIndexConsistent()
isIndexConsistent in interface IndexLifecycleManagerfalse.public void closeQuietly(org.apache.lucene.search.IndexSearcher issueSearcher)
public int size()
size in interface Sizedsize in interface IndexLifecycleManagerIndexLifecycleManager.reIndexAll(Context)public long optimize()
IndexLifecycleManageroptimize in interface IndexLifecycleManagerpublic void deIndex(Issue issue) throws IndexException
IssueIndexManagerdeIndex in interface IssueIndexingServicedeIndex in interface IssueIndexManagerIndexExceptionpublic void deIndexIssueObjects(Set<Issue> issuesToDelete, boolean updateReplicatedIndexStore) throws IndexException
IssueIndexManagerdeIndexIssueObjects in interface IssueIndexingServicedeIndexIssueObjects in interface IssueIndexManagerIndexExceptionpublic void deIndex(org.ofbiz.core.entity.GenericValue entity)
throws IndexException
IssueIndexManagerdeIndex in interface IssueIndexManagerIndexExceptionpublic String getPluginsRootPath()
IssueIndexManagergetPluginsRootPath in interface IssueIndexManagerpublic List<String> getExistingPluginsPaths()
IssueIndexManagerIssueIndexManager.getPluginsRootPath().
If a plugin index root path does not exist, or is empty (no sub-directopries exist) then an empty collection will be returned.
getExistingPluginsPaths in interface IssueIndexManagerpublic org.apache.lucene.search.IndexSearcher getIssueSearcher()
IssueIndexManagerIndexSearcher that can be used to search the issue index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close() when you are done with it.
Alternatively you should really call SearchProviderFactory#getSearcher(String)) passing in SearchProviderFactory.ISSUE_INDEX as it is a managed searcher and all the closing semantics are handled for
you.
getIssueSearcher in interface IssueIndexManagerpublic org.apache.lucene.search.IndexSearcher getCommentSearcher()
IssueIndexManagerIndexSearcher that can be used to search the comment index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close() when you are done with it.
Alternatively you should really call SearchProviderFactory#getSearcher(String)) passing in SearchProviderFactory.COMMENT_INDEX as it is a managed searcher and all the closing semantics are handled for
you.
getCommentSearcher in interface IssueIndexManagerpublic org.apache.lucene.search.IndexSearcher getChangeHistorySearcher()
IssueIndexManagerIndexSearcher that can be used to search the change history index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close() when you are done with it.
Alternatively you should really call SearchProviderFactory#getSearcher(String)) passing in SearchProviderFactory.CHANGE_HISTORY_INDEX as it is a managed searcher and all the closing semantics are handled
for you.
getChangeHistorySearcher in interface IssueIndexManagerpublic org.apache.lucene.search.IndexSearcher getWorklogSearcher()
IssueIndexManagerIndexSearcher that can be used to search the worklog index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close() when you are done with it.
Alternatively you should really call SearchProviderFactory#getSearcher(String)) passing in SearchProviderFactory.WORKLOG_INDEX as it is a managed searcher and all the closing semantics are handled for
you.
getWorklogSearcher in interface IssueIndexManagerpublic Collection<String> getAllIndexPaths()
getAllIndexPaths in interface IndexLifecycleManagerpublic void shutdown()
IndexLifecycleManagershutdown in interface IndexLifecycleManagershutdown in interface Shutdownpublic static void flushThreadLocalSearchers()
Copyright © 2002-2018 Atlassian. All Rights Reserved.