You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Obs AI Assistant] Use update-by-query for semantic_text migration (elastic#220255)
Closes: elastic#220339
**Background**
The `semantic_text` migration will migrate content from `text` field to
`semantic_text` field. It does so with a recursive function that
continuously retrieves knowledge base entries if they do not contain
`semantic_text` and updates them accordingly.
**Problem**
It is possible to save empty knowledge base entries
(elastic#220342) where `text` and
`semantic_text` will be empty. Doing this will cause the migration
script to run indefinitely leading to OOM on the affected clusters.
## Workarounds for clusters that cannot / won't upgrade
Temporary workaround is to delete empty knowledge base entries:
```jsonc
POST .kibana-observability-ai-assistant-kb/_delete_by_query
{
"query": {
"bool": {
"must": [{ "exists": { "field": "text" }}],
"must_not": [ { "wildcard": { "text": "*" } }
]
}
}
}
```
If you want to perform a dry run (find offending documents without
deleting them) run this:
```jsonc
GET .kibana-observability-ai-assistant-kb/_search
{
"query": {
"bool": {
"must": [{ "exists": { "field": "text" }}],
"must_not": [ { "wildcard": { "text": "*" } }
]
}
}
}
```
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/observability_ai_assistant/server/service/knowledge_base_service/reindex_knowledge_base.ts
-3Lines changed: 0 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -193,8 +193,5 @@ export async function isReIndexInProgress({
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/observability_ai_assistant/server/service/startup_migrations/populate_missing_semantic_text_fields.ts
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/observability_ai_assistant/server/service/startup_migrations/run_startup_migrations.ts
0 commit comments