diff --git a/apps/memos-local-openclaw/src/storage/sqlite.ts b/apps/memos-local-openclaw/src/storage/sqlite.ts index 2caa8e5d3..43cdcbbd5 100644 --- a/apps/memos-local-openclaw/src/storage/sqlite.ts +++ b/apps/memos-local-openclaw/src/storage/sqlite.ts @@ -1307,7 +1307,7 @@ export class SqliteStore { */ function sanitizeFtsQuery(raw: string): string { const tokens = raw - .replace(/[."""(){}[\]*:^~!@#$%&\\/<>,;'`]/g, " ") + .replace(/[."""(){}[\]*:^~!@#$%&\\/<>,;'`-]/g, " ") .split(/\s+/) .map((t) => t.trim().replace(/^-+|-+$/g, "")) .filter((t) => t.length > 1) diff --git a/apps/memos-local-openclaw/tests/storage.test.ts b/apps/memos-local-openclaw/tests/storage.test.ts index fa919e0d8..fc1956bd5 100644 --- a/apps/memos-local-openclaw/tests/storage.test.ts +++ b/apps/memos-local-openclaw/tests/storage.test.ts @@ -98,6 +98,14 @@ describe("SqliteStore", () => { expect(Array.isArray(results)).toBe(true); }); + it("should handle FTS query containing date separators", () => { + store.insertChunk(makeChunk({ id: "c1", content: "release date 2026-03-14", summary: "release note" })); + + const results = store.ftsSearch("2026-03-14", 10); + expect(Array.isArray(results)).toBe(true); + expect(results.length).toBeGreaterThanOrEqual(1); + }); + it("should get neighbor chunks", () => { const now = Date.now(); store.insertChunk(makeChunk({ id: "c1", turnId: "t1", seq: 0, createdAt: now }));