Interface IndexIndexingPlan<R>

    • Method Detail

      • add

        void add​(DocumentReferenceProvider documentReferenceProvider,
                 DocumentContributor documentContributor)
        Add a document to the index, assuming that the document is absent from the index.
        Parameters:
        documentReferenceProvider - A source of information about the identity of the document to add.
        documentContributor - A contributor to the document, adding fields to the indexed document.
      • addOrUpdate

        void addOrUpdate​(DocumentReferenceProvider documentReferenceProvider,
                         DocumentContributor documentContributor)
        Update a document in the index, or add it if it's absent from the index.
        Parameters:
        documentReferenceProvider - A source of information about the identity of the document to update.
        documentContributor - A contributor to the document, adding fields to the indexed document.
      • delete

        void delete​(DocumentReferenceProvider documentReferenceProvider)
        Delete a document from the index.
        Parameters:
        documentReferenceProvider - A source of information about the identity of the document to delete.
      • process

        void process()
        Process works before their execution, i.e. do as much as possible without writing to the index.

        Calling this method is optional: the execute() method will perform the processing if necessary.

      • execute

        default CompletableFuture<?> execute()
        Start executing all the works in this plan, and clear the plan so that it can be re-used.
        Returns:
        A CompletableFuture that will be completed when all the works are complete. The future will be completed with an exception if a work failed.
      • executeAndReport

        CompletableFuture<IndexIndexingPlanExecutionReport<R>> executeAndReport()
        Start executing all the works in this plan, and clear the plan so that it can be re-used.
        Returns:
        A CompletableFuture that will hold an execution report when all the works are complete. The future will be completed normally even if a work failed, but the report will contain an exception.
      • discard

        void discard()
        Discard all works that are present in this plan.