-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hybrid search #53
base: master
Are you sure you want to change the base?
Conversation
@@ -89,3 +105,74 @@ export const awaitUntilIndexed = async (client: HttpClient | Index, timeoutMilli | |||
|
|||
throw new Error(`Indexing is not completed in ${timeoutMillis} ms.`); | |||
}; | |||
|
|||
export const populateSparseIndex = async (index: Index, namespace: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe parametrize this function with dimension count etc. and randomize the vectors? So that we can use it in multiple places
src/commands/client/types.ts
Outdated
metadata?: TMetadata; | ||
data?: string; | ||
}; | ||
|
||
export type NAMESPACE = string; | ||
|
||
export type Dict = Record<string, unknown>; | ||
|
||
export type SparseVector = [indices: number[], values: number[]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add jsdocs for this type, so that people makes sense of its structure while coding
@@ -1,11 +1,12 @@ | |||
import type { NAMESPACE } from "@commands/client/types"; | |||
import type { NAMESPACE, SparseVector } from "@commands/client/types"; | |||
import { Command } from "@commands/command"; | |||
|
|||
type NoInfer<T> = T extends infer U ? U : never; | |||
|
|||
type VectorPayload<TMetadata> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type allows both vector and sparseVector not be passed. At least one should be passed in type
src/commands/client/query/types.ts
Outdated
fusionAlgorithm?: FusionAlgorithm; | ||
queryMode?: QueryMode; | ||
} & ( | ||
| { vector?: number[]; sparseVector?: SparseVector; data?: never } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least one of vector or sparseVector should be passed imo
10c907b
to
880a25e
Compare
tests pass locally but fail on Github |
CI won't pass because we haven't created and added indexes which use sparse/hybrid index yet.
README will be updated once everything is finished.