mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-18 02:58:28 +00:00
Fix document missing exception for ES/OS update entity (#24562)
This commit is contained in:
parent
8ad2760d11
commit
fccd717fbd
@ -361,6 +361,7 @@ public class ElasticSearchEntityManager implements EntityManagementClient {
|
|||||||
.id(docId)
|
.id(docId)
|
||||||
.refresh(Refresh.True)
|
.refresh(Refresh.True)
|
||||||
.scriptedUpsert(true)
|
.scriptedUpsert(true)
|
||||||
|
.upsert(params)
|
||||||
.script(
|
.script(
|
||||||
s ->
|
s ->
|
||||||
s.inline(
|
s.inline(
|
||||||
@ -375,7 +376,20 @@ public class ElasticSearchEntityManager implements EntityManagementClient {
|
|||||||
"Successfully updated entity in ElasticSearch for index: {}, docId: {}",
|
"Successfully updated entity in ElasticSearch for index: {}, docId: {}",
|
||||||
indexName,
|
indexName,
|
||||||
docId);
|
docId);
|
||||||
} catch (IOException | ElasticsearchException e) {
|
} catch (ElasticsearchException e) {
|
||||||
|
if (e.status() == 404) {
|
||||||
|
LOG.warn(
|
||||||
|
"Document not found during update for index: {}, docId: {}. The document may not have been indexed yet.",
|
||||||
|
indexName,
|
||||||
|
docId);
|
||||||
|
} else {
|
||||||
|
LOG.error(
|
||||||
|
"Failed to update entity in ElasticSearch for index: {}, docId: {}",
|
||||||
|
indexName,
|
||||||
|
docId,
|
||||||
|
e);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"Failed to update entity in ElasticSearch for index: {}, docId: {}", indexName, docId, e);
|
"Failed to update entity in ElasticSearch for index: {}, docId: {}", indexName, docId, e);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -369,6 +369,7 @@ public class OpenSearchEntityManager implements EntityManagementClient {
|
|||||||
.id(docId)
|
.id(docId)
|
||||||
.refresh(Refresh.True)
|
.refresh(Refresh.True)
|
||||||
.scriptedUpsert(true)
|
.scriptedUpsert(true)
|
||||||
|
.upsert(params)
|
||||||
.script(
|
.script(
|
||||||
s ->
|
s ->
|
||||||
s.inline(
|
s.inline(
|
||||||
@ -381,7 +382,17 @@ public class OpenSearchEntityManager implements EntityManagementClient {
|
|||||||
|
|
||||||
LOG.info(
|
LOG.info(
|
||||||
"Successfully updated entity in OpenSearch for index: {}, docId: {}", indexName, docId);
|
"Successfully updated entity in OpenSearch for index: {}, docId: {}", indexName, docId);
|
||||||
} catch (IOException | OpenSearchException e) {
|
} catch (OpenSearchException e) {
|
||||||
|
if (e.status() == 404) {
|
||||||
|
LOG.warn(
|
||||||
|
"Document not found during update for index: {}, docId: {}. The document may not have been indexed yet.",
|
||||||
|
indexName,
|
||||||
|
docId);
|
||||||
|
} else {
|
||||||
|
LOG.error(
|
||||||
|
"Failed to update entity in OpenSearch for index: {}, docId: {}", indexName, docId, e);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"Failed to update entity in OpenSearch for index: {}, docId: {}", indexName, docId, e);
|
"Failed to update entity in OpenSearch for index: {}, docId: {}", indexName, docId, e);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user