balibabu
commited on
Commit
·
dedc63e
1
Parent(s):
6eec14a
feat: Click on the chunk on the search page to locate the corresponding file location #2247 (#2399)
Browse files### 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
CHANGED
|
@@ -100,6 +100,7 @@ export interface ITestingChunk {
|
|
| 100 |
vector: number[];
|
| 101 |
vector_similarity: number;
|
| 102 |
highlight: string;
|
|
|
|
| 103 |
}
|
| 104 |
|
| 105 |
export interface ITestingDocument {
|
|
|
|
| 100 |
vector: number[];
|
| 101 |
vector_similarity: number;
|
| 102 |
highlight: string;
|
| 103 |
+
positions: number[][];
|
| 104 |
}
|
| 105 |
|
| 106 |
export interface ITestingDocument {
|
web/src/pages/search/index.tsx
CHANGED
|
@@ -146,7 +146,12 @@ const SearchPage = () => {
|
|
| 146 |
className={styles.chunks}
|
| 147 |
renderItem={(item) => (
|
| 148 |
<List.Item>
|
| 149 |
-
<Card
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
<Space>
|
| 151 |
<ImageWithPopover
|
| 152 |
id={item.img_id}
|
|
|
|
| 146 |
className={styles.chunks}
|
| 147 |
renderItem={(item) => (
|
| 148 |
<List.Item>
|
| 149 |
+
<Card
|
| 150 |
+
className={styles.card}
|
| 151 |
+
onClick={() =>
|
| 152 |
+
clickDocumentButton(item.doc_id, item as any)
|
| 153 |
+
}
|
| 154 |
+
>
|
| 155 |
<Space>
|
| 156 |
<ImageWithPopover
|
| 157 |
id={item.img_id}
|