Interface ReindexProvider<D>

  • Type Parameters:
    D - The type of document which can be written

    public interface ReindexProvider<D>
    Generic interface for writing a record or document to a particular index, such as Solr.
    Author:
    Kelly Tisdell (ktisdell)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deleteByField​(String fieldName, String fieldValue, int commitWithinMillis, String... indexNames)
      Perform a delete operation, deleting by a field name and value.
      void write​(D document, String... indexNames)
      Writes a document or record to one or more indices.
      void write​(List<D> documents, String... indexNames)
      Writes a batch of documents to one or more indices.
    • Method Detail

      • write

        void write​(D document,
                   String... indexNames)
            throws SearchIndexException
        Writes a document or record to one or more indices.
        Parameters:
        document - the document to write
        indexNames - the indices to write to
        Throws:
        SearchIndexException - if an error occurs writing to the index
      • write

        void write​(List<D> documents,
                   String... indexNames)
            throws SearchIndexException
        Writes a batch of documents to one or more indices.
        Parameters:
        documents - the documents to write
        indexNames - the indices to write to
        Throws:
        SearchIndexException - if an error occurs writing to the index
      • deleteByField

        void deleteByField​(String fieldName,
                           String fieldValue,
                           int commitWithinMillis,
                           @NonNull
                           String... indexNames)
                    throws SearchIndexException
        Perform a delete operation, deleting by a field name and value. For example, to delete all documents with a contextId value of "10": deleteByField("contextId", "10", index)
        Parameters:
        fieldName - The field name
        fieldValue - The field value.
        commitWithinMillis - time to commit within after write
        indexNames - The name of the collections to update.
        Throws:
        SearchIndexException - If the delete request fails for any reason.