Imported observations were invisible to the MCP search tool because the FTS5 content table was not reliably updated during bulk import. The import handler now calls rebuildObservationsFTSIndex() after inserting new observations, ensuring the full-text search index is consistent. A new SessionStore.rebuildObservationsFTSIndex() method encapsulates the FTS5 rebuild command and is a no-op when the observations_fts table does not exist (e.g. FTS5 unavailable on Windows).
This commit is contained in:
@@ -391,6 +391,13 @@ export class DataRoutes extends BaseRouteHandler {
|
||||
stats.observationsSkipped++;
|
||||
}
|
||||
}
|
||||
|
||||
// Rebuild FTS index so imported observations are immediately searchable.
|
||||
// The FTS5 content table relies on triggers for incremental updates, but
|
||||
// those triggers may not have fired correctly for all import paths.
|
||||
if (stats.observationsImported > 0) {
|
||||
store.rebuildObservationsFTSIndex();
|
||||
}
|
||||
}
|
||||
|
||||
// Import prompts (depends on sessions)
|
||||
|
||||
Reference in New Issue
Block a user