feat(core): extend SearchResult type with snippet and imports#74
Merged
feat(core): extend SearchResult type with snippet and imports#74
Conversation
Implements #69 - Richer Search Results (sub-issue 3/5) Changes: - Add SearchResultMetadata interface with typed fields for: - path, type, language, name, startLine, endLine - exported, signature, docstring - snippet (new from #67) - imports (new from #68) - Update SearchResult to use SearchResultMetadata - Update prepareDocumentsForEmbedding to include snippet/imports - Use SearchResultMetadata in LanceDBVectorStore.search() Features: - Typed metadata fields provide IDE autocomplete - Backward compatible with existing code (fields optional) - Extensible via index signature for custom fields Testing: - All 1265 tests passing - TypeScript compiles without errors Closes #69
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #69 - Third sub-issue of Epic #66 (Richer Search Results)
Changes
packages/core/src/vector/types.tsSearchResultMetadatainterface with typed fieldsSearchResultto useSearchResultMetadatainstead ofRecord<string, unknown>packages/core/src/vector/store.tssearch()to cast parsed metadata toSearchResultMetadatapackages/core/src/indexer/utils/documents.tssnippetandimportstoprepareDocumentsForEmbedding()snippetandimportstoprepareDocumentForEmbedding()SearchResultMetadata Fields
Features
✅ Typed metadata fields with IDE autocomplete
✅ Backward compatible (all fields optional)
✅ Extensible via index signature for custom use cases
✅
snippetandimportsnow flow through to search resultsTesting
Related Issues