Interface IssueIndexer

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

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
    • deindexIssues

      Index.Result deindexIssues(@Nonnull Collection<? extends WithId> issues, @Nonnull Context context)
      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

      Index.Result deindexIssues(@Nonnull Collection<? extends WithId> issues, @Nonnull Context context, boolean shouldReplicate)
      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 or not 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

      Index.Result reindexComments(@Nonnull Collection<Comment> comments, @Nonnull Context context, boolean shouldReplicate)
      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.
    • 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

      Index.Result reindexWorklogs(@Nonnull Collection<Worklog> worklogs, @Nonnull Context context, boolean shouldReplicate)
    • deindexComments

      Index.Result deindexComments(@Nonnull Collection<? extends WithId> comments, @Nonnull Context context, boolean shouldReplicate)
    • deindexWorklogs

      Index.Result deindexWorklogs(@Nonnull Collection<? extends WithId> worklogs, @Nonnull Context context, boolean shouldReplicate)
    • conditionalUpdateWithVersion

      Index.Result conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document)
      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

      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 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
    • 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

      void deleteIndexes(@Nonnull IssueIndexingParams issueIndexingParams)
      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

      List<String> getIndexPaths()
    • getIndexRootPath

      String getIndexRootPath()