com.atlassian.jira.issue.index
Interface IssueIndexManager

All Superinterfaces:
IndexLifecycleManager, Shutdown, Sized
All Known Implementing Classes:
BulkOnlyIndexManager, DefaultIndexManager, MemoryIndexManager

@PublicApi
public interface IssueIndexManager
extends IndexLifecycleManager

Manages Lucene search indexes.


Field Summary
static org.apache.lucene.util.Version LUCENE_VERSION
          Deprecated. Use LuceneVersion.get() instead.
 
Method Summary
 void deIndex(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use deIndex(com.atlassian.jira.issue.Issue) instead. Since v5.0.
 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.
 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.
 Collection<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.
 void hold()
          Temporarily suspend indexing on this thread.
 boolean isHeld()
          Return true if the index is held.
 void reIndex(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use reIndex(com.atlassian.jira.issue.Issue) instead. Since v5.0.
 void reIndex(Issue issue)
          Reindex an issue (eg.
 void reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory)
          Reindex an issue (eg.
 long reIndexAll()
          Reindex all issues.
 long reIndexAll(Context context, boolean useBackgroundReindexing, boolean updateReplicatedIndexStore)
          Reindex all issues.
 long reIndexAll(Context context, boolean useBackgroundReindexing, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndexStore)
          Reindex all issues.
 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 reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues)
          Deprecated. Use reIndexIssueObjects(java.util.Collection) instead. Since v5.0.
 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 release()
          Release indexing on this thread.
 
Methods inherited from interface com.atlassian.jira.util.index.IndexLifecycleManager
activate, activate, deactivate, getAllIndexPaths, isIndexConsistent, isIndexingEnabled, optimize, reIndexAll, reIndexAllIssuesInBackground, reIndexAllIssuesInBackground, shutdown, size
 
Methods inherited from interface com.atlassian.jira.util.collect.Sized
isEmpty
 

Field Detail

LUCENE_VERSION

@Deprecated
static final org.apache.lucene.util.Version LUCENE_VERSION
Deprecated. Use LuceneVersion.get() instead.
Since:
6.0.5
Method Detail

reIndexAll

long reIndexAll()
                throws IndexException
Reindex all issues.

Returns:
Reindex time in ms.
Throws:
IndexException

reIndexAll

long reIndexAll(Context context,
                boolean useBackgroundReindexing,
                boolean updateReplicatedIndexStore)
                throws IndexException
Reindex all issues.

Parameters:
context - used to report progress back to the user or to the logs. Must not be null
useBackgroundReindexing - whether to index in the background or not. If the useBackgroundReindexing option is set to true, then comments and change history will not be reindexed.
updateReplicatedIndexStore - whether to update the replicated index or not
Returns:
Reindex time in ms.
Throws:
IndexException

reIndexAll

long reIndexAll(Context context,
                boolean useBackgroundReindexing,
                boolean reIndexComments,
                boolean reIndexChangeHistory,
                boolean updateReplicatedIndexStore)
                throws IndexException
Reindex all issues. If the useBackgroundReindexing option is set to true, then only the basic issue information will be reindexed, unless the reIndexComments or reIndexChangeHistory parameters are also set. This is considered the normal mode for background re-indexing and is sufficient to correct the index for changes in the system configuration, but not for changes to the indexing language. If useBackgroundReindexing is set to false, than everything is always reindexed.

Parameters:
context - used to report progress back to the user or to the logs. Must not be null
useBackgroundReindexing - whether to index in the background or not
reIndexComments - 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.
updateReplicatedIndexStore - whether to update the replicated index or not
Returns:
Reindex time in ms.
Throws:
IndexException
Since:
6.2

reIndex

void reIndex(org.ofbiz.core.entity.GenericValue issue)
             throws IndexException
Deprecated. Use reIndex(com.atlassian.jira.issue.Issue) instead. Since v5.0.

Reindex an issue (eg. after field updates).

Throws:
IndexException

reIndexIssues

long reIndexIssues(IssuesIterable issuesIterable,
                   Context context)
                   throws IndexException
Reindex a list of issues, passing an optional event that will be set progress

Parameters:
issuesIterable - IssuesIterable
context - used to report progress back to the user or to the logs. Must not be null.
Returns:
Reindex time in ms.
Throws:
IndexException

reIndexIssues

long reIndexIssues(IssuesIterable issuesIterable,
                   Context context,
                   boolean reIndexComments,
                   boolean reIndexChangeHistory)
                   throws IndexException
Reindex a list of issues, passing an optional event that will be set progress. This method can optionally also index the comments and change history.

Parameters:
issuesIterable - IssuesIterable
context - used to report progress back to the user or to the logs. Must not be null.
reIndexComments - a boolean indicating whether to index issue comments
reIndexChangeHistory - a boolean indicating whether to index issue change history
Returns:
Reindex time in ms.
Throws:
IndexException
Since:
v5.2

reIndex

void reIndex(Issue issue)
             throws IndexException
Reindex an issue (eg. after field updates).

Throws:
IndexException

reIndex

void reIndex(Issue issue,
             boolean reIndexComments,
             boolean reIndexChangeHistory)
             throws IndexException
Reindex an issue (eg. after field updates).

Throws:
IndexException
Since:
v5.2

reIndexComments

long reIndexComments(Collection<Comment> comments)
                     throws IndexException
Reindexes a collection of comments.

Parameters:
comments - a collection of Comment
Throws:
IndexException
Since:
v5.2

reIndexComments

long reIndexComments(Collection<Comment> comments,
                     Context context)
                     throws IndexException
Reindexes a collection of comments.

Parameters:
comments - a collection of Comment
context - used to report progress back to the user or to the logs. Must not be null.
Throws:
IndexException
Since:
v5.2

reIndexComments

long reIndexComments(Collection<Comment> comments,
                     Context context,
                     boolean updateReplicatedIndexStore)
                     throws IndexException
Reindexes a collection of comments.

Parameters:
comments - a collection of Comment
context - used to report progress back to the user or to the logs. Must not be null.
updateReplicatedIndexStore - whether to update the replicated index or not
Throws:
IndexException
Since:
v6.1

deIndex

void deIndex(org.ofbiz.core.entity.GenericValue issue)
             throws IndexException
Deprecated. Use deIndex(com.atlassian.jira.issue.Issue) instead. Since v5.0.

Remove an issue from the search index.

Throws:
IndexException

deIndex

void deIndex(Issue issue)
             throws IndexException
Remove an issue from the search index.

Throws:
IndexException

deIndexIssueObjects

void deIndexIssueObjects(Set<Issue> issuesToDelete,
                         boolean updateReplicatedIndexStore)
                         throws IndexException
Remove a set of issues from the search index.

Throws:
IndexException

reIndexIssues

long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues)
                   throws IndexException
Deprecated. Use reIndexIssueObjects(java.util.Collection) instead. Since v5.0.

Reindex a set of issues (GenericValues). Use reIndexIssueObjects(Collection) instead when possible.

Parameters:
issues - The Issue GenericValues to reindex.
Returns:
Reindex time in ms.
Throws:
IndexException

reIndexIssueObjects

long reIndexIssueObjects(Collection<? extends Issue> issueObjects)
                         throws IndexException
Reindex a set of issues.

Parameters:
issueObjects - Set of Issues to reindex.
Returns:
Reindex time in ms.
Throws:
IndexException
Since:
v5.2

reIndexIssueObjects

long reIndexIssueObjects(Collection<? extends Issue> issueObjects,
                         boolean reIndexComments,
                         boolean reIndexChangeHistory)
                         throws IndexException
Reindex a set of issues.

Parameters:
issueObjects - Set of Issues to reindex.
Returns:
Reindex time in ms.
Throws:
IndexException

reIndexIssueObjects

long reIndexIssueObjects(Collection<? extends Issue> issueObjects,
                         boolean reIndexComments,
                         boolean reIndexChangeHistory,
                         boolean updateReplicatedIndexStore)
                         throws IndexException
Reindex a set of issues.

Parameters:
issueObjects - Set of Issues to reindex.
reIndexComments - whether to reindex the comments or not
reIndexChangeHistory - whether to reindex changeHistory or not
updateReplicatedIndexStore - whether to store index operations in the replicated index store
Returns:
Reindex time in ms.
Throws:
IndexException

hold

void hold()
Temporarily suspend indexing on this thread. All index requests will be queued and processed when release is called.

Since:
v5.1

isHeld

boolean isHeld()
Return true if the index is held.

Since:
v5.1

release

long release()
             throws IndexException
Release indexing on this thread. All queued index requests will be processed.

Returns:
Reindex time in ms.
Throws:
IndexException - if an error occurs
Since:
v5.1

getPluginsRootPath

String getPluginsRootPath()
Get the root path of the index directory for plugins. Any plugin that keeps indexes should create its own sub-directory under this path and create its indexes in its own sub-directory


getExistingPluginsPaths

Collection<String> getExistingPluginsPaths()
Returns a collection of Strings, each one representing the absolute path to the actual existing directory where a plugin keeps its indexes. Each directory in the collection should be a sub-directory under the plugin's index root path. See getPluginsRootPath().

If a plugin index root path does not exist, or is empty (no sub-directopries exist) then an empty collection will be returned.


getIssueSearcher

org.apache.lucene.search.IndexSearcher getIssueSearcher()
Get an IndexSearcher 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.


getCommentSearcher

org.apache.lucene.search.IndexSearcher getCommentSearcher()
Get an IndexSearcher 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.


getChangeHistorySearcher

org.apache.lucene.search.IndexSearcher getChangeHistorySearcher()
Get an IndexSearcher 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.


getAnalyzerForSearching

org.apache.lucene.analysis.Analyzer getAnalyzerForSearching()
Returns an Analyzer for searching.

Returns:
an analyzer for searching

getAnalyzerForIndexing

org.apache.lucene.analysis.Analyzer getAnalyzerForIndexing()
Returns an Analyzer for indexing.

Returns:
an analyzer for indexing.


Copyright © 2002-2014 Atlassian. All Rights Reserved.