Pinecone search query always returns the same result, Is it a caching issue?

Hello,

Whenever I do a pinecone search for the first time, It returns an accurate result.

However if i change my query, and do another pinecone search it will return the same result that I got the first time…so my results are only accurate on the first instance.

I have around 90 vectors on my pinecone database, Here is a code snippet of how i am querying the data:
const queryRequest = {
ids: [data.best_practice_id],
topK: 5,
vector: vectors,
namespace: ‘qa-farmers’,
includeValues: true,
includeMetadata: true,
noCache: true
}

const queryResponse = await index.query({ queryRequest });
tools.Logger.log(() => `query response ${JSON.stringify(queryResponse)}`);

What is the best way to handle this issue?

Hi @Joy,

Can I ask, why are you passing the vector IDs in the query? Typically those are only used if you know the values you need to load, and then are typically used with fetch. Try taking that parameter out instead.

When you run your queries, are you using different vectors in the query each time?

Okay @Cory_Pinecone Thanks,

Can i get the metadata as well by using the fetch function?

Yes, fetch returns both the values and any metadata for the vector.

This is quite helpful @Cory_Pinecone Thanks for unblocking