Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion apps/memos-local-openclaw/src/storage/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions apps/memos-local-openclaw/tests/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
Expand Down
Loading