fix: support multiple -c collection filters in search/query/vsearch#176
Open
neomatrixyzy wants to merge 1 commit intotobi:mainfrom
Open
fix: support multiple -c collection filters in search/query/vsearch#176neomatrixyzy wants to merge 1 commit intotobi:mainfrom
neomatrixyzy wants to merge 1 commit intotobi:mainfrom
Conversation
Previously, passing multiple -c flags (e.g. -c plans -c sessions) only searched the last collection because parseArgs used type:'string' without multiple:true. This silently dropped all but the last -c value. Changes: - qmd.ts: Add multiple:true to parseArgs collection option, add normalizeCollectionFilter() helper, update search/vectorSearch/querySearch to handle string[] collection filters - store.ts: Change searchFTS collectionId?:number to collectionNames?:string[], change searchVec collectionName?:string to collectionNames?:string[], update SQL from '= ?' to 'IN (?, ?, ...)', update Store interface, HybridQueryOptions, VectorSearchOptions, and all internal callers Fixes tobi#175
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
Fix for #175 — multiple
-c/--collectionflags are now properly supported across all search modes.The Bug
parseArgsinqmd.tsusedtype: "string"withoutmultiple: truefor the collection option. When passing-c plans -c sessions, only"sessions"(the last value) was kept. This silently broke multi-collection search workflows.The Fix
qmd.ts(CLI layer)multiple: truetoparseArgscollection optionnormalizeCollectionFilter()helper to normalizestring | string[]→string[] | undefinedsearch(),vectorSearch(), andquerySearch()to validate and pass collection arraysstore.ts(search engine layer)searchFTS:collectionId?: number→collectionNames?: string[], SQL= ?→IN (?, ?, ...)searchVec:collectionName?: string→collectionNames?: string[], SQL= ?→IN (?, ?, ...)Storeinterface,HybridQueryOptions,VectorSearchOptionshybridQueryandvectorSearchQueryTesting
Files Changed
src/qmd.ts— parseArgs + command handlers (~20 lines)src/store.ts— search functions + interfaces (~40 lines)Fixes #175