From cbdf54cf365e6e3e2942309acbd9fed14c5dfe0e Mon Sep 17 00:00:00 2001 From: balibabu Date: Fri, 13 Sep 2024 08:54:26 +0800 Subject: [PATCH] feat: Click on the chunk on the search page to locate the corresponding file location #2247 (#2399) ### What problem does this PR solve? feat: Click on the chunk on the search page to locate the corresponding file location #2247 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- web/src/interfaces/database/knowledge.ts | 1 + web/src/pages/search/index.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/interfaces/database/knowledge.ts b/web/src/interfaces/database/knowledge.ts index 666b6a49..0740ac91 100644 --- a/web/src/interfaces/database/knowledge.ts +++ b/web/src/interfaces/database/knowledge.ts @@ -100,6 +100,7 @@ export interface ITestingChunk { vector: number[]; vector_similarity: number; highlight: string; + positions: number[][]; } export interface ITestingDocument { diff --git a/web/src/pages/search/index.tsx b/web/src/pages/search/index.tsx index 05e9a009..4eec7601 100644 --- a/web/src/pages/search/index.tsx +++ b/web/src/pages/search/index.tsx @@ -146,7 +146,12 @@ const SearchPage = () => { className={styles.chunks} renderItem={(item) => ( - + + clickDocumentButton(item.doc_id, item as any) + } + >