Remove summary functionality from VaultIndexer
This commit is contained in:
+2
-13
@@ -1,7 +1,7 @@
|
||||
// src/vault-indexer.ts
|
||||
|
||||
import { VaultIndexEntry } from './types';
|
||||
import { Logger, sanitizeFilePath } from './utils';
|
||||
import { Logger } from './utils';
|
||||
|
||||
interface Frontmatter {
|
||||
title?: string;
|
||||
@@ -31,23 +31,12 @@ interface ScoreResult {
|
||||
}
|
||||
|
||||
class VaultIndexer {
|
||||
private summaries: Map<string, string> = new Map();
|
||||
private vault: VaultLike | null = null;
|
||||
|
||||
constructor(vault: VaultLike) {
|
||||
this.vault = vault;
|
||||
}
|
||||
|
||||
private storeSummary(filePath: string, summary: string): void {
|
||||
const sanitizedPath = sanitizeFilePath(filePath);
|
||||
this.summaries.set(sanitizedPath, summary);
|
||||
}
|
||||
|
||||
getSummary(filePath: string): string | undefined {
|
||||
const sanitizedPath = sanitizeFilePath(filePath);
|
||||
return this.summaries.get(sanitizedPath);
|
||||
}
|
||||
|
||||
async searchVault(query: string, limit: number = 5): Promise<VaultIndexEntry[]> {
|
||||
if (!query || !query.trim()) {
|
||||
return [];
|
||||
@@ -188,7 +177,7 @@ class VaultIndexer {
|
||||
|
||||
const headingMatches = content.match(/^#{1,6} (.*?)$/gm);
|
||||
if (headingMatches) {
|
||||
headings.push(...headingMatches.map((h: string) => h.replace(/^# /, '')));
|
||||
headings.push(...headingMatches.map((h: string) => h.replace(/^#{1,6} /, '')));
|
||||
}
|
||||
|
||||
const paragraphMatch = content.match(/^([^#]*?)(?=#|\n\n|$)/s);
|
||||
|
||||
Reference in New Issue
Block a user