feat(query): add shared query base classes#25
Open
nkanu17 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Closing this for now. This stacked Query Core branch should only become a PR if/when we explicitly decide to add new scope on top of #9. |
Contributor
Author
Contributor
Author
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
This PR adds the shared query foundation needed for the remaining RedisVL Python parity work.
BaseQueryfor common FT.SEARCH query state and validation.BaseVectorQueryfor vector-specific state, datatype normalization, and shared vector validation.VectorQuery,VectorRangeQuery,FilterQuery,CountQuery, andTextQueryonto the shared base classes without changing their constructor-facing APIs.setFilter(...)setReturnFields(...)paging(...)sortBy(...)sortBy()throughSearchIndex.search().Stacking
This PR is stacked on top of #9 (
feat/hybrid-search).Do not merge this PR before #9 lands.
TDD Notes
Tests were written first and failed before implementation:
tests/unit/query/base.test.tsBaseQuerycommon config, filter updates, return fields, skip-decode fields, paging, sorting, and validation.BaseVectorQueryvector state, datatype normalization, defensive copying, and validation.tests/unit/query/vector.test.tsVectorQueryinheritance fromBaseVectorQuery/BaseQuery.paging,setReturnFields, andsetFilterbehavior.tests/unit/indexes/search-index.test.tssortBy()reachesFT.SEARCHoptions.Implementation followed after the failing tests were in place.
Verification
npm run type-checknpm run test:unitnpm run format:check -- src/query/base.ts src/query/vector.ts src/query/range.ts src/query/filter-query.ts src/query/count.ts src/query/text.ts src/indexes/search-index.ts tests/unit/query/base.test.ts tests/unit/query/vector.test.ts tests/unit/indexes/search-index.test.tsnpm run buildREDISVL_SKIP_HYBRID=true npm test -- tests/integration