Files
obsidian-mcp/internal/repository/search_index.go
Andrey Epifancev da289d4a7e feat: Implement foundation layer with domain entities and repository interfaces
- Add complete domain layer: Note, Vault, WikiLink, Tag, Frontmatter, Graph entities
- Implement repository interfaces for data access abstraction
- Create comprehensive configuration system with YAML and env support
- Add CLI entry point with signal handling and graceful shutdown
- Fix mermaid diagram syntax in design.md (array notation)
- Add CLAUDE.md for development guidance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-08 10:22:28 +04:00

36 lines
837 B
Go

package repository
import (
"context"
"github.com/user/obsidian-mcp-server/internal/domain"
)
type SearchResult struct {
Path string `json:"path"`
Score float64 `json:"score"`
Matches []*SearchMatch `json:"matches"`
}
type SearchMatch struct {
Line int `json:"line"`
Content string `json:"content"`
ContextBefore string `json:"context_before"`
ContextAfter string `json:"context_after"`
}
type SearchQuery struct {
Query string
MaxResults int
CaseSensitive bool
UseRegex bool
ContextLines int
}
type SearchIndex interface {
Index(ctx context.Context, note *domain.Note) error
Remove(ctx context.Context, path string) error
Search(ctx context.Context, query *SearchQuery) ([]*SearchResult, error)
Rebuild(ctx context.Context, notes []*domain.Note) error
Clear() error
}