Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,23 @@ async function populateSemanticTextFieldRecursively({
}) {
logger.debug('Initalizing semantic text migration for knowledge base entries...');

const { count } = await esClient.asInternalUser.count({
index: resourceNames.aliases.kb,
query: {
bool: {
must_not: {
exists: { field: 'semantic_text' },
},
},
},
});
logger.info(`Documents missing 'semantic_text' before migration: ${count}`);

if (count === 0) {
logger.debug('No documents missing semantic_text field, skipping migration.');
return;
}

await pRetry(
async () => {
await waitForModel({ esClient, logger, config });
Expand Down