Is this a new bug?
In other words: Is this an error, flaw, failure or fault? Please search Github issues and check our Community Forum to see if someone has already reported the bug you encountered.
If this is a request for help or troubleshooting code in your own Pinecone project, please join the Pinecone Community Forum.
Describe the bug
As of December of 2024 the recommended approach for hybrid search is to use cascading retrieval via a separate dense and sparse index (blog post). To implement this in typescript the SDK must support querying using only the sparseVector parameter.
Currently the query function is typed in a way that requires vector to be supplied. The QueryByVectorValues type must make vector parameter optional.
Error information
"my-sparse-index" must be a sparse index.
const index = pc.index<T>("my-sparse-index");
const res = await index.query({
vector: [], // required to satisfy typing
sparseVector: sparseVector.vectors[0],
topK: 10,
});
Results in:
PineconeArgumentError: You must enter an array of `RecordValues` in order to query by vector values.
Steps to reproduce the issue locally
Include steps to reproduce the issue here. If you have sample code or a script that can be used to replicate this issue, please include that as well (including any dependent files to run the code).
See section above.
Environment
- OS and version: Mac
- Node version: v20.18.1
- Typescript SDK version: "@pinecone-database/pinecone": "^5.1.1",
Additional context
Current work around:
const index = pc.index<T>("my-sparse-index");
// @ts-ignore
const res = await index.query({
sparseVector: sparseVector.vectors[0],
topK: 10,
});
Is this a new bug?
In other words: Is this an error, flaw, failure or fault? Please search Github issues and check our Community Forum to see if someone has already reported the bug you encountered.
If this is a request for help or troubleshooting code in your own Pinecone project, please join the Pinecone Community Forum.
Describe the bug
As of December of 2024 the recommended approach for hybrid search is to use cascading retrieval via a separate dense and sparse index (blog post). To implement this in typescript the SDK must support querying using only the
sparseVectorparameter.Currently the query function is typed in a way that requires
vectorto be supplied. The QueryByVectorValues type must makevectorparameter optional.Error information
"my-sparse-index" must be a sparse index.
Results in:
PineconeArgumentError: You must enter an array of `RecordValues` in order to query by vector values.Steps to reproduce the issue locally
Include steps to reproduce the issue here. If you have sample code or a script that can be used to replicate this issue, please include that as well (including any dependent files to run the code).
See section above.
Environment
Additional context
Current work around: