Interface OpenSearchService

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
MultiOpenSearchServiceImpl, OpenSearchServiceImpl

public interface OpenSearchService extends AutoCloseable
Provides access to indexing operations in OpenSearch
Author:
joseross
  • Method Details

    • searchField

      List<String> searchField(String indexName, String field, org.opensearch.client.opensearch._types.query_dsl.Query query) throws OpenSearchException
      Performs a search for a specific field
      Parameters:
      indexName - the name of the index
      field - the name of the field
      query - the filters to apply
      Returns:
      the list of values that match the search
      Throws:
      OpenSearchException - if there is any error during the operation
    • searchId

      Map<String,Object> searchId(String indexName, String docId)
    • index

      void index(String indexName, String siteId, String docId, Map<String,Object> doc)
    • index

      default void index(String indexName, String siteId, String docId, String xml) throws OpenSearchException
      Performs an index for the given xml file
      Parameters:
      indexName - the name of the index
      siteId - the name of the site
      docId - the id of the document
      xml - the content of the document
      Throws:
      OpenSearchException - if there is any error during the operation
    • index

      void index(String indexName, String siteId, String docId, String xml, Map<String,Object> additionalFields) throws OpenSearchException
      Performs an index for the given xml file
      Parameters:
      indexName - the name of the index
      siteId - the name of the site
      docId - the id of the document
      xml - the content of the document
      additionalFields - additional fields to index
      Throws:
      OpenSearchException - if there is any error during the operation
    • indexBinary

      void indexBinary(String indexName, String siteName, String path, org.craftercms.core.service.Content content, Map<String,Object> additionalFields) throws OpenSearchException
      Performs an index for the given binary file
      Parameters:
      indexName - the name of the index
      siteName - the name of the site
      path - the path of the document
      content - the content of the document
      additionalFields - the additional fields to index
      Throws:
      OpenSearchException - if there is any error during the operation
    • indexBinary

      default void indexBinary(String indexName, String siteName, String path, org.craftercms.core.service.Content content) throws OpenSearchException
      Throws:
      OpenSearchException
    • indexBinary

      void indexBinary(String indexName, String siteName, String path, org.springframework.core.io.Resource resource, Map<String,Object> additionalFields) throws OpenSearchException
      Throws:
      OpenSearchException
    • indexBinary

      default void indexBinary(String indexName, String siteName, String path, org.springframework.core.io.Resource resource) throws OpenSearchException
      Throws:
      OpenSearchException
    • delete

      void delete(String indexName, String siteId, String docId) throws OpenSearchException
      Performs a delete for the given document
      Parameters:
      indexName - the name of the index
      siteId - the id of the site
      docId - the id of the document
      Throws:
      OpenSearchException - if there is any error during the operation
    • refresh

      void refresh(String indexName) throws OpenSearchException
      Performs a refresh for a given index
      Parameters:
      indexName - the name of the index
      Throws:
      OpenSearchException - if there is any error during the operation