Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add hybrid search #53

wants to merge 5 commits into from

Conversation

CahidArda
Copy link
Contributor

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.

Copy link

linear bot commented Dec 26, 2024

@@ -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) => {
Copy link
Collaborator

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

metadata?: TMetadata;
data?: string;
};

export type NAMESPACE = string;

export type Dict = Record<string, unknown>;

export type SparseVector = [indices: number[], values: number[]];
Copy link
Collaborator

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> = {
Copy link
Collaborator

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

fusionAlgorithm?: FusionAlgorithm;
queryMode?: QueryMode;
} & (
| { vector?: number[]; sparseVector?: SparseVector; data?: never }
Copy link
Collaborator

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

@CahidArda CahidArda force-pushed the DX-1497-hybrid-search branch from 10c907b to 880a25e Compare December 27, 2024 15:25
@CahidArda
Copy link
Contributor Author

tests pass locally but fail on Github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants