Interface FullIndexationService

All Known Implementing Classes:
AbstractIndexer, ElasticsearchIndexer, ImportClient

@Path("indexer-api/v1/full") public interface FullIndexationService
Run a full import into a new index. If product and content data should be indexed, consider using different indexes. Otherwise make sure to use the same fields for the same content type, e.g. both kind of documents can have a textual "title" field, but both kind of documents shouldn't have for example an "author" field, which could be used for product facets (e.g. book authors) but not for faceting the content documents (e.g. blog post authors).
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Add one or more documents to a running import session.
    void
    Cancels import which results in a deletion of the temporary index.
    boolean
    Finishes the import, flushing the new index and (in case there is already an index with the initialized name) replacing the old one.
    startImport(String indexName, String locale)
    Start a new full import.
  • Method Details

    • startImport

      @GET @Path("start/{indexName}") ImportSession startImport(String indexName, String locale) throws IllegalStateException
      Start a new full import. Returns a handle containing meta data, that has to be passed to all following calls.
      Parameters:
      indexName - index name, that should match the regular expression '[a-z0-9_-]+'
      locale - used for language dependent settings
      Returns:
      ImportSession that should be used for follow up requests to add data to that new index
      Throws:
      IllegalStateException - in case there is already a full-import running for that index.
    • add

      @POST @Path("add") int add(BulkImportData data) throws Exception
      Add one or more documents to a running import session.
      Parameters:
      data - bulk data which consist of the ImportSession and one or more products that should be added to that index.
      Returns:
      the amount of documents that were successfully added to the index
      Throws:
      Exception - in case import session is invalid
    • done

      @POST @Path("done") boolean done(ImportSession session) throws Exception
      Finishes the import, flushing the new index and (in case there is already an index with the initialized name) replacing the old one.
      Parameters:
      session - ImportSession that should be closed.
      Returns:
      true on success, otherwise false
      Throws:
      Exception - if import session is invalid
    • cancel

      @POST @Path("cancel") void cancel(ImportSession session) throws Exception
      Cancels import which results in a deletion of the temporary index.
      Parameters:
      session - ImportSession that contains the information, which index should be dropped.
      Throws:
      Exception - if import session is invalid