Class OpenSearchClient
java.lang.Object
org.openmetadata.service.search.opensearch.OpenSearchClient
- All Implemented Interfaces:
SearchClient
-
Field Summary
Fields inherited from interface org.openmetadata.service.search.SearchClient
ADD, ADD_UPDATE_LINEAGE, DEFAULT_UPDATE_SCRIPT, DELETE, GLOBAL_SEARCH_ALIAS, NOT_IMPLEMENTED_ERROR_TYPE, PROPAGATE_ENTITY_REFERENCE_FIELD_SCRIPT, PROPAGATE_FIELD_SCRIPT, REMOVE_DOMAINS_CHILDREN_SCRIPT, REMOVE_LINEAGE_SCRIPT, REMOVE_PROPAGATED_ENTITY_REFERENCE_FIELD_SCRIPT, REMOVE_PROPAGATED_FIELD_SCRIPT, REMOVE_TAGS_CHILDREN_SCRIPT, REMOVE_TEST_SUITE_CHILDREN_SCRIPT, SOFT_DELETE_RESTORE_SCRIPT, UPDATE, UPDATE_ADDED_DELETE_GLOSSARY_TAGS, UPDATE_PROPAGATED_ENTITY_REFERENCE_FIELD_SCRIPT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Responsejavax.json.JsonObjectstatic List<os.org.opensearch.search.aggregations.AggregationBuilder>buildAggregation(javax.json.JsonObject aggregations) os.org.opensearch.action.bulk.BulkResponsebulk(os.org.opensearch.action.bulk.BulkRequest data, os.org.opensearch.client.RequestOptions options) voidclose()voidcreateAliases(IndexMapping indexMapping) voidcreateEntity(String indexName, String docId, String doc) voidcreateIndex(IndexMapping indexMapping, String indexMappingContent) os.org.opensearch.client.RestHighLevelClientvoidcreateTimeSeriesEntity(String indexName, String docId, String doc) voidvoiddeleteEntity(String indexName, String docId) voiddeleteEntityByFields(String indexName, List<org.apache.commons.lang3.tuple.Pair<String, String>> fieldAndValue) voiddeleteIndex(IndexMapping indexMapping) getSortedDate(String team, Long scheduleTime, Long currentTime, DataInsightChartResult.DataInsightChartType chartType, String indexName) intgetSuccessFromBulkResponse(os.org.opensearch.action.bulk.BulkResponse response) booleanindexExists(String indexName) booleanjavax.ws.rs.core.ResponselistDataInsightChartResult(Long startTs, Long endTs, String tier, String team, DataInsightChartResult.DataInsightChartType dataInsightChartName, Integer size, Integer from, String queryFilter, String dataReportIndex) javax.ws.rs.core.Responsesearch(SearchRequest request) javax.ws.rs.core.ResponsesearchByField(String fieldName, String fieldValue, String index) javax.ws.rs.core.ResponsesearchBySourceUrl(String sourceUrl) javax.ws.rs.core.ResponsesearchLineage(String fqn, int upstreamDepth, int downstreamDepth, String queryFilter, boolean deleted, String entityType) voidsoftDeleteOrRestoreChildren(String indexName, String scriptTxt, List<org.apache.commons.lang3.tuple.Pair<String, String>> fieldAndValue) voidsoftDeleteOrRestoreEntity(String indexName, String docId, String scriptTxt) javax.ws.rs.core.Responsesuggest(SearchRequest request) voidupdateChildren(String indexName, org.apache.commons.lang3.tuple.Pair<String, String> fieldAndValue, org.apache.commons.lang3.tuple.Pair<String, Map<String, Object>> updates) voidvoidupdateIndex(IndexMapping indexMapping, String indexMappingContent) voidupdateLineage(String indexName, org.apache.commons.lang3.tuple.Pair<String, String> fieldAndValue, Map<String, Object> lineagaData) voidupdateOpenSearch(os.org.opensearch.action.update.UpdateRequest updateRequest) voidupdateSearch(os.org.opensearch.action.update.UpdateRequest updateRequest) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openmetadata.service.search.SearchClient
bulk, createElasticSearchSSLContext, getSuccessFromBulkResponse
-
Constructor Details
-
OpenSearchClient
-
-
Method Details
-
isClientAvailable
public boolean isClientAvailable()- Specified by:
isClientAvailablein interfaceSearchClient
-
indexExists
- Specified by:
indexExistsin interfaceSearchClient
-
createIndex
- Specified by:
createIndexin interfaceSearchClient
-
createAliases
- Specified by:
createAliasesin interfaceSearchClient
-
updateIndex
- Specified by:
updateIndexin interfaceSearchClient
-
deleteIndex
- Specified by:
deleteIndexin interfaceSearchClient
-
search
- Specified by:
searchin interfaceSearchClient- Throws:
IOException
-
searchBySourceUrl
- Specified by:
searchBySourceUrlin interfaceSearchClient- Throws:
IOException
-
searchLineage
public javax.ws.rs.core.Response searchLineage(String fqn, int upstreamDepth, int downstreamDepth, String queryFilter, boolean deleted, String entityType) throws IOException - Specified by:
searchLineagein interfaceSearchClient- Throws:
IOException
-
searchByField
public javax.ws.rs.core.Response searchByField(String fieldName, String fieldValue, String index) throws IOException - Specified by:
searchByFieldin interfaceSearchClient- Throws:
IOException
-
aggregate
public javax.ws.rs.core.Response aggregate(String index, String fieldName, String value, String query) throws IOException - Specified by:
aggregatein interfaceSearchClient- Throws:
IOException
-
buildAggregation
public static List<os.org.opensearch.search.aggregations.AggregationBuilder> buildAggregation(javax.json.JsonObject aggregations) -
aggregate
public javax.json.JsonObject aggregate(String query, String index, javax.json.JsonObject aggregationJson) throws IOException - Specified by:
aggregatein interfaceSearchClient- Throws:
IOException
-
updateSearch
public void updateSearch(os.org.opensearch.action.update.UpdateRequest updateRequest) -
suggest
- Specified by:
suggestin interfaceSearchClient- Throws:
IOException
-
getSearchType
- Specified by:
getSearchTypein interfaceSearchClient
-
createEntity
- Specified by:
createEntityin interfaceSearchClient
-
createTimeSeriesEntity
- Specified by:
createTimeSeriesEntityin interfaceSearchClient
-
deleteByScript
- Specified by:
deleteByScriptin interfaceSearchClient
-
deleteEntity
- Specified by:
deleteEntityin interfaceSearchClient
-
deleteEntityByFields
public void deleteEntityByFields(String indexName, List<org.apache.commons.lang3.tuple.Pair<String, String>> fieldAndValue) - Specified by:
deleteEntityByFieldsin interfaceSearchClient
-
softDeleteOrRestoreEntity
- Specified by:
softDeleteOrRestoreEntityin interfaceSearchClient
-
softDeleteOrRestoreChildren
public void softDeleteOrRestoreChildren(String indexName, String scriptTxt, List<org.apache.commons.lang3.tuple.Pair<String, String>> fieldAndValue) - Specified by:
softDeleteOrRestoreChildrenin interfaceSearchClient
-
updateEntity
- Specified by:
updateEntityin interfaceSearchClient
-
updateChildren
public void updateChildren(String indexName, org.apache.commons.lang3.tuple.Pair<String, String> fieldAndValue, org.apache.commons.lang3.tuple.Pair<String, Map<String, Object>> updates) - Specified by:
updateChildrenin interfaceSearchClient
-
updateLineage
public void updateLineage(String indexName, org.apache.commons.lang3.tuple.Pair<String, String> fieldAndValue, Map<String, Object> lineagaData) - Specified by:
updateLineagein interfaceSearchClient- Parameters:
indexName-fieldAndValue-
-
updateOpenSearch
public void updateOpenSearch(os.org.opensearch.action.update.UpdateRequest updateRequest) -
close
public void close()- Specified by:
closein interfaceSearchClient
-
bulk
public os.org.opensearch.action.bulk.BulkResponse bulk(os.org.opensearch.action.bulk.BulkRequest data, os.org.opensearch.client.RequestOptions options) throws IOException - Specified by:
bulkin interfaceSearchClient- Throws:
IOException
-
getSuccessFromBulkResponse
public int getSuccessFromBulkResponse(os.org.opensearch.action.bulk.BulkResponse response) - Specified by:
getSuccessFromBulkResponsein interfaceSearchClient
-
getSortedDate
public TreeMap<Long,List<Object>> getSortedDate(String team, Long scheduleTime, Long currentTime, DataInsightChartResult.DataInsightChartType chartType, String indexName) throws IOException, ParseException - Specified by:
getSortedDatein interfaceSearchClient- Throws:
IOExceptionParseException
-
listDataInsightChartResult
public javax.ws.rs.core.Response listDataInsightChartResult(Long startTs, Long endTs, String tier, String team, DataInsightChartResult.DataInsightChartType dataInsightChartName, Integer size, Integer from, String queryFilter, String dataReportIndex) throws IOException, ParseException - Specified by:
listDataInsightChartResultin interfaceSearchClient- Throws:
IOExceptionParseException
-
createOpenSearchClient
public os.org.opensearch.client.RestHighLevelClient createOpenSearchClient(ElasticSearchConfiguration esConfig)
-