Package org.craftercms.search.opensearch
Interface OpenSearchService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
MultiOpenSearchServiceImpl,OpenSearchServiceImpl
Provides access to indexing operations in OpenSearch
- Author:
- joseross
-
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms a delete for the given documentdefault voidPerforms an index for the given xml filevoidindex(String indexName, String siteId, String docId, String xml, Map<String, Object> additionalFields) Performs an index for the given xml filevoiddefault voidindexBinary(String indexName, String siteName, String path, org.craftercms.core.service.Content content) voidindexBinary(String indexName, String siteName, String path, org.craftercms.core.service.Content content, Map<String, Object> additionalFields) Performs an index for the given binary filedefault voidindexBinary(String indexName, String siteName, String path, org.springframework.core.io.Resource resource) voidindexBinary(String indexName, String siteName, String path, org.springframework.core.io.Resource resource, Map<String, Object> additionalFields) voidPerforms a refresh for a given indexsearchField(String indexName, String field, org.opensearch.client.opensearch._types.query_dsl.Query query) Performs a search for a specific fieldMethods inherited from interface java.lang.AutoCloseable
close
-
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 indexfield- the name of the fieldquery- the filters to apply- Returns:
- the list of values that match the search
- Throws:
OpenSearchException- if there is any error during the operation
-
searchId
-
index
-
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 indexsiteId- the name of the sitedocId- the id of the documentxml- 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 OpenSearchExceptionPerforms an index for the given xml file- Parameters:
indexName- the name of the indexsiteId- the name of the sitedocId- the id of the documentxml- the content of the documentadditionalFields- 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 OpenSearchExceptionPerforms an index for the given binary file- Parameters:
indexName- the name of the indexsiteName- the name of the sitepath- the path of the documentcontent- the content of the documentadditionalFields- 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
Performs a delete for the given document- Parameters:
indexName- the name of the indexsiteId- the id of the sitedocId- the id of the document- Throws:
OpenSearchException- if there is any error during the operation
-
refresh
Performs a refresh for a given index- Parameters:
indexName- the name of the index- Throws:
OpenSearchException- if there is any error during the operation
-