Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

feat: Click on the chunk on the search page to locate the corresponding file location #2247 (#2399)

balibabucbdf54cf365e
diff --git a/web/src/interfaces/database/knowledge.ts b/web/src/interfaces/database/knowledge.ts
index 666b6a490c..0740ac91e9 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 05e9a009af..4eec7601be 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) => (
<List.Item>
- <Card className={styles.card}>
+ <Card
+ className={styles.card}
+ onClick={() =>
+ clickDocumentButton(item.doc_id, item as any)
+ }
+ >
<Space>
<ImageWithPopover
id={item.img_id}