@PublicApi public interface

IssueIndexManager

implements IndexLifecycleManager
com.atlassian.jira.issue.index.IssueIndexManager
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Manages Lucene search indexes.

Summary

Fields
public static final Version LUCENE_VERSION This field is deprecated. Use get() instead.
Public Methods
void deIndex(GenericValue issue)
This method is 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.
Analyzer getAnalyzerForIndexing()
Returns an Analyzer for indexing.
Analyzer getAnalyzerForSearching()
Returns an Analyzer for searching.
IndexSearcher getChangeHistorySearcher()
Get an IndexSearcher that can be used to search the change history index.
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.
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(Issue issue)
Reindex an issue (eg.
void reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory)
Reindex an issue (eg.
void reIndex(GenericValue issue)
This method is deprecated. Use reIndex(com.atlassian.jira.issue.Issue) instead. Since v5.0.
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, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndexStore)
Reindex a set of issues.
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 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(Collection<GenericValue> issues)
This method is 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 release()
Release indexing on this thread.
[Expand]
Inherited Methods
From interface com.atlassian.jira.util.Shutdown
From interface com.atlassian.jira.util.collect.Sized
From interface com.atlassian.jira.util.index.IndexLifecycleManager

Fields

public static final Version LUCENE_VERSION

This field is deprecated.
Use get() instead.

Public Methods

public void deIndex (GenericValue issue)

This method is deprecated.
Use deIndex(com.atlassian.jira.issue.Issue) instead. Since v5.0.

Remove an issue from the search index.

public void deIndex (Issue issue)

Remove an issue from the search index.

public void deIndexIssueObjects (Set<Issue> issuesToDelete, boolean updateReplicatedIndexStore)

Remove a set of issues from the search index.

public Analyzer getAnalyzerForIndexing ()

Returns an Analyzer for indexing.

Returns
  • an analyzer for indexing.

public Analyzer getAnalyzerForSearching ()

Returns an Analyzer for searching.

Returns
  • an analyzer for searching

public IndexSearcher getChangeHistorySearcher ()

Get an IndexSearcher that can be used to search the change history index.

Note: This is an unmanaged IndexSearcher. You MUST call close() when you are done with it. Alternatively you should really call passing in CHANGE_HISTORY_INDEX as it is a managed searcher and all the closing semantics are handled for you.

public IndexSearcher getCommentSearcher ()

Get an IndexSearcher that can be used to search the comment index.

Note: This is an unmanaged IndexSearcher. You MUST call close() when you are done with it. Alternatively you should really call passing in COMMENT_INDEX as it is a managed searcher and all the closing semantics are handled for you.

public 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.

public IndexSearcher getIssueSearcher ()

Get an IndexSearcher that can be used to search the issue index.

Note: This is an unmanaged IndexSearcher. You MUST call close() when you are done with it. Alternatively you should really call passing in ISSUE_INDEX as it is a managed searcher and all the closing semantics are handled for you.

public 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

public void hold ()

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

public boolean isHeld ()

Return true if the index is held.

public void reIndex (Issue issue)

Reindex an issue (eg. after field updates).

public void reIndex (Issue issue, boolean reIndexComments, boolean reIndexChangeHistory)

Reindex an issue (eg. after field updates).

public void reIndex (GenericValue issue)

This method is deprecated.
Use reIndex(com.atlassian.jira.issue.Issue) instead. Since v5.0.

Reindex an issue (eg. after field updates).

public long reIndexAll ()

Reindex all issues.

Returns
  • Reindex time in ms.

public long reIndexAll (Context context, boolean useBackgroundReindexing, boolean updateReplicatedIndexStore)

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.

public long reIndexAll (Context context, boolean useBackgroundReindexing, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndexStore)

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.

public long reIndexComments (Collection<Comment> comments)

Reindexes a collection of comments.

Parameters
comments a collection of Comment

public long reIndexComments (Collection<Comment> comments, Context context)

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.

public long reIndexComments (Collection<Comment> comments, Context context, boolean updateReplicatedIndexStore)

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

public long reIndexIssueObjects (Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndexStore)

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.

public long reIndexIssueObjects (Collection<? extends Issue> issueObjects)

Reindex a set of issues.

Parameters
issueObjects Set of Issues to reindex.
Returns
  • Reindex time in ms.

public long reIndexIssueObjects (Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory)

Reindex a set of issues.

Parameters
issueObjects Set of Issues to reindex.
Returns
  • Reindex time in ms.

public long reIndexIssues (IssuesIterable issuesIterable, Context context, boolean reIndexComments, boolean reIndexChangeHistory)

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.

public long reIndexIssues (Collection<GenericValue> issues)

This method is 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.

public long reIndexIssues (IssuesIterable issuesIterable, Context context)

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.

public long release ()

Release indexing on this thread. All queued index requests will be processed.

Returns
  • Reindex time in ms.
Throws
IndexException if an error occurs