Interface IssueIndexer

All Superinterfaces:
BackupContributor, UnmanagedIndexSearcherProvider
All Known Implementing Classes:
DefaultIssueIndexer, MockIssueIndexer, OpenSearchIssueIndexer

public interface IssueIndexer extends UnmanagedIndexSearcherProvider, BackupContributor
  • 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

      Index.Result deindexIssues(@Nonnull Collection<? extends WithId> issues, @Nonnull Context context)
      Delete any existing documents (in the issue index invalid input: '&' 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.
      use deindexIssues(Collection, Context) instead. shouldReplicate is not relevant when using OpenSearch.
      Delete any existing documents (in the issue index invalid input: '&' 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 reindexed
      conditionalUpdate - set to true to use conditional updates when writing to the index
      shouldReplicate - 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.
      use reindexComments(Collection, Context) after version 12.0 instead. shouldReplicate is 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. Use reindexWorklogs(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. Use deindexComments(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. Use deindexWorklogs(Collection, Context) instead.
    • conditionalUpdateWithVersion

      @Deprecated(since="10.7", forRemoval=true) Index.Result conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Index a Document conditionally based on the entity id and the version which are resolved by IndexDirectoryFactory.Name.getEntityIdFromDocument(Document) and IndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
      Parameters:
      indexName - define the target index
      document - the document needs to be indexed
    • conditionalUpdateWithVersion

      @Deprecated(since="10.7", forRemoval=true) 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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Index an issue document with its related documents conditionally based on the entity ids and the versions which are resolved by IndexDirectoryFactory.Name.getEntityIdFromDocument(Document) and IndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
      Parameters:
      issueDocument - issue document needs to be indexed
      commentDocuments - issue's comment documents
      changeHistoryDocuments - issue's history change documents
      worklogDocuments - issue's worklog documents
    • indexDocument

      Index.Result indexDocument(IndexRequest indexRequest)
      Index a document using the provided IndexRequest.

      WARNING: This method bypasses the standard JIRA versioning flow and should be used with extreme caution. It does not automatically manage entity versions through the EntityVersioningManager, which can lead to version conflicts and inconsistent index state if the same entity is updated through normal JIRA operations.

      Recommended Usage: This method should only be used in controlled scenarios where:

      • The caller explicitly manages document versioning
      • Testing or development scenarios where version conflicts are acceptable

      Parameters:
      indexRequest - the request containing the document ID, optional version, document type, and field values to be indexed. Must not be null.
      Returns:
      the result of the indexing operation
      Since:
      10.7
    • 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 use deleteIndexes().
      Delete selected indexes.
      Parameters:
      issueIndexingParams - parameters describing which indexes should be deleted.
    • deIndexProject

      Index.Result deIndexProject(Project project, boolean shouldReplicate)
      Remove all documents connected with given project
      Parameters:
      project - project object
      shouldReplicate -
    • shutdown

      void shutdown()
    • getIndexPaths

      @Deprecated(since="10.4", forRemoval=true) List<String> 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(since="10.4", forRemoval=true) String 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.