Package com.atlassian.jira.issue.index
Interface IssueIndexer
- All Superinterfaces:
BackupContributor,UnmanagedIndexSearcherProvider
- All Known Implementing Classes:
DefaultIssueIndexer,MockIssueIndexer,OpenSearchIssueIndexer
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionconditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document) Index aDocumentconditionally based on the entity id and the version which are resolved byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)andIndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)conditionalUpdateWithVersion(org.apache.lucene.document.Document issueDocument, Collection<org.apache.lucene.document.Document> commentDocuments, Collection<org.apache.lucene.document.Document> changeHistoryDocuments, Collection<org.apache.lucene.document.Document> worklogDocuments) Index an issue document with its related documents conditionally based on the entity ids and the versions which are resolved byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)andIndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)default Index.ResultdeindexComments(Collection<? extends WithId> comments, Context context) deindexComments(Collection<? extends WithId> comments, Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5, shouldReplicate parameter is only applicable to Lucene, will be removed when Lucene support is removed.deindexIssues(Collection<? extends WithId> issues, Context context) Delete any existing documents (in the issue index & all related entity indexes) for the Issues represented by the supplied WithIdsdeindexIssues(Collection<? extends WithId> issues, Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.usedeindexIssues(Collection, Context)instead.deIndexProject(Project project, boolean shouldReplicate) Remove all documents connected with given projectdefault Index.ResultdeindexWorklogs(Collection<? extends WithId> worklogs, Context context) deindexWorklogs(Collection<? extends WithId> worklogs, Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5, shouldReplicate parameter is only applicable to Lucene, will be removed when Lucene support is removed.voidDelete all indexes.voiddeleteIndexes(IssueIndexingParams issueIndexingParams) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5 usedeleteIndexes().Deprecated, for removal: This API element is subject to removal in a future version.since 10.4.Deprecated, for removal: This API element is subject to removal in a future version.since 10.4.intGets number of indexing threads.indexIssues(EnclosedIterable<Issue> issues, Context context, IssueIndexingParams issueIndexingParams) Add documents for the supplied issues.indexIssuesBatchMode(IssuesBatcher batcher, Context context, IssueIndexingParams issueIndexingParams) Index all issues from the given batcher.optimize()default Index.ResultreindexComments(Collection<Comment> comments, Context context) reindexComments(Collection<Comment> comments, Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.usereindexComments(Collection, Context)after version 12.0 instead.reindexCommentsInParallel(Collection<Comment> comments, Context context) Reindex a collection of issue comments on multiple threads.reindexIssues(EnclosedIterable<Issue> issues, Context context, IssueIndexingParams issueIndexingParams, boolean conditionalUpdate, boolean shouldReplicate) Re-index the given issues, delete any existing documents and add new ones.reindexIssuesBatchMode(IssuesBatcher issuesBatcher, Context context, IssueIndexingParams issueIndexingParams) Reindex issues from the given collection.default Index.ResultreindexWorklogs(Collection<Worklog> worklogs, Context context) reindexWorklogs(Collection<Worklog> worklogs, Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5, shouldReplicate parameter is only applicable to Lucene, will be removed when Lucene support is removed.reindexWorklogsInParallel(Collection<Worklog> worklogs, Context context) Reindex a collection of issue worklogs on multiple threads.voidshutdown()Methods inherited from interface com.atlassian.jira.index.ha.backup.BackupContributor
contributeToBackupMethods inherited from interface com.atlassian.jira.issue.index.UnmanagedIndexSearcherProvider
openEntitySearcher
-
Method Details
-
indexIssues
Index.Result indexIssues(@Nonnull EnclosedIterable<Issue> issues, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams) Add documents for the supplied issues.- Parameters:
issues- An iterable of issues to index.context- for showing the user the current status.issueIndexingParams- parameters describing what should be reindexed- Since:
- 6.4
-
getNumberOfIndexingThreads
int getNumberOfIndexingThreads()Gets number of indexing threads.Configured by 'jira.index.issue.threads'.
- Returns:
- the number of indexing threads.
- Since:
- 10.7
-
deindexIssues
Delete any existing documents (in the issue index & all related entity indexes) for the Issues represented by the supplied WithIds- Parameters:
issues- An iterable of WithIds for the Issues to de-index.context- for showing the user the current status.
-
deindexIssues
@Deprecated(since="10.4", forRemoval=true) Index.Result deindexIssues(@Nonnull Collection<? extends WithId> issues, @Nonnull Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.usedeindexIssues(Collection, Context)instead.shouldReplicateis not relevant when using OpenSearch.Delete any existing documents (in the issue index & all related entity indexes) for the Issues represented by the supplied WithIds- Parameters:
issues- An iterable of WithIds for the Issues to de-index.context- for showing the user the current status.shouldReplicate- whether the index changes should be replicated to the other nodes in the cluster.
-
reindexIssuesBatchMode
AccumulatingResultBuilder reindexIssuesBatchMode(@Nonnull IssuesBatcher issuesBatcher, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams) Reindex issues from the given collection. As this method is not using conditional updates it must be executed under index write lock. It reindexes issues in multiple threads using the same parallelism mechanism as { @link IssueIndexer#indexIssuesBatchMode}- Parameters:
issuesBatcher- an iterable over issue batches.context- for showing the user the current status.issueIndexingParams- parameters describing what should be reindexed- Since:
- 9.3
-
reindexIssues
Index.Result reindexIssues(@Nonnull EnclosedIterable<Issue> issues, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams, boolean conditionalUpdate, boolean shouldReplicate) Re-index the given issues, delete any existing documents and add new ones.- Parameters:
issues- An iterable of issues to index.context- for showing the user the current status.issueIndexingParams- parameters describing what should be reindexedconditionalUpdate- set to true to use conditional updates when writing to the indexshouldReplicate- whether or not the index changes should be replicated to the other nodes in the cluster.- Since:
- 6.4
-
reindexComments
@Deprecated(since="10.5", forRemoval=true) Index.Result reindexComments(@Nonnull Collection<Comment> comments, @Nonnull Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.usereindexComments(Collection, Context)after version 12.0 instead.shouldReplicateis not relevant when in OpenSearch.Reindex a collection of issue comments.- Parameters:
comments- Comments to be reindexed.context- for showing the user the current status.shouldReplicate- whether or not the index changes should be replicated to the other nodes in the cluster.
-
reindexComments
default Index.Result reindexComments(@Nonnull Collection<Comment> comments, @Nonnull Context context) -
reindexCommentsInParallel
Index.Result reindexCommentsInParallel(@Nonnull Collection<Comment> comments, @Nonnull Context context) Reindex a collection of issue comments on multiple threads. This will not replicate the comments to the other nodes in cluster. As this method does not use conditional updates, it must be executed under index write lock.- Parameters:
comments- Comments to be reindexed.context- for showing the user the current status.
-
reindexWorklogsInParallel
Index.Result reindexWorklogsInParallel(@Nonnull Collection<Worklog> worklogs, @Nonnull Context context) Reindex a collection of issue worklogs on multiple threads. This will not replicate the worklogs to the other nodes in cluster. As this method does not use conditional updates, it must be executed under index write lock.- Parameters:
worklogs- Worklogs to be reindexed.context- for showing the user the current status.
-
reindexWorklogs
default Index.Result reindexWorklogs(@Nonnull Collection<Worklog> worklogs, @Nonnull Context context) -
deindexComments
default Index.Result deindexComments(@Nonnull Collection<? extends WithId> comments, @Nonnull Context context) -
deindexWorklogs
default Index.Result deindexWorklogs(@Nonnull Collection<? extends WithId> worklogs, @Nonnull Context context) -
reindexWorklogs
@Deprecated(since="10.5", forRemoval=true) Index.Result reindexWorklogs(@Nonnull Collection<Worklog> worklogs, @Nonnull Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5, shouldReplicate parameter is only applicable to Lucene, will be removed when Lucene support is removed. UsereindexWorklogs(Collection, Context)instead. -
deindexComments
@Deprecated(since="10.5", forRemoval=true) Index.Result deindexComments(@Nonnull Collection<? extends WithId> comments, @Nonnull Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5, shouldReplicate parameter is only applicable to Lucene, will be removed when Lucene support is removed. UsedeindexComments(Collection, Context)instead. -
deindexWorklogs
@Deprecated(since="10.5", forRemoval=true) Index.Result deindexWorklogs(@Nonnull Collection<? extends WithId> worklogs, @Nonnull Context context, boolean shouldReplicate) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5, shouldReplicate parameter is only applicable to Lucene, will be removed when Lucene support is removed. UsedeindexWorklogs(Collection, Context)instead. -
conditionalUpdateWithVersion
Index.Result conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document) Index aDocumentconditionally based on the entity id and the version which are resolved byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)andIndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)- Parameters:
indexName- define the target indexdocument- the document needs to be indexed
-
conditionalUpdateWithVersion
Index.Result conditionalUpdateWithVersion(org.apache.lucene.document.Document issueDocument, Collection<org.apache.lucene.document.Document> commentDocuments, Collection<org.apache.lucene.document.Document> changeHistoryDocuments, Collection<org.apache.lucene.document.Document> worklogDocuments) Index an issue document with its related documents conditionally based on the entity ids and the versions which are resolved byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)andIndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)- Parameters:
issueDocument- issue document needs to be indexedcommentDocuments- issue's comment documentschangeHistoryDocuments- issue's history change documentsworklogDocuments- issue's worklog documents
-
indexIssuesBatchMode
AccumulatingResultBuilder indexIssuesBatchMode(@Nonnull IssuesBatcher batcher, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams) Index all issues from the given batcher.- Parameters:
batcher- An iterable over issue batches.context- for showing the user the current status.issueIndexingParams- parameters describing what should be reindexed- Since:
- 8.0
-
optimize
Index.Result optimize() -
deleteIndexes
void deleteIndexes()Delete all indexes. -
deleteIndexes
@Deprecated(since="10.5", forRemoval=true) void deleteIndexes(@Nonnull IssueIndexingParams issueIndexingParams) Deprecated, for removal: This API element is subject to removal in a future version.since 10.5 usedeleteIndexes().Delete selected indexes.- Parameters:
issueIndexingParams- parameters describing which indexes should be deleted.
-
deIndexProject
Remove all documents connected with given project- Parameters:
project- project objectshouldReplicate-
-
shutdown
void shutdown() -
getIndexPaths
Deprecated, for removal: This API element is subject to removal in a future version.since 10.4. It's Lucene specific, no longer relevant for OpenSearch. No replacement. -
getIndexRootPath
Deprecated, for removal: This API element is subject to removal in a future version.since 10.4. It's Lucene specific, no longer relevant for OpenSearch. No replacement.
-