Hello, I’m using C# and the API to upsert and query vectors. I’ve managed to sucessfully upsert vectors to the index however I can’t query them even though I get a successful response from the server as shown here :
Firstly, looking at your response headers, there’s an error code ‘grpc-status: 12’. This is a gRPC error code, which stands for ‘UNIMPLEMENTED’. It means that the server understands the request, but it’s not capable of fulfilling it because the functionality isn’t implemented.
Secondly, looking at your query code, it seems like there might be an issue with how you’re representing the vector in your request body. Vectors are typically represented as arrays of numbers, but in your code, it seems like you’re treating the vector as a string. This could be causing the issue.
To correctly represent the vector, you should treat the vector as an array of numbers, not a string. Like so:
csharpCopy code
Content = new StringContent("{\"namespace\":\"default-namespace\",\"topK\":1,\"includeValues\":\"false\",\"includeMetadata\":\"true\",\"vector\":" + vector + "}", Encoding.UTF8, "application/json")
Here, vector should be a JSON string representing an array of numbers, like "[1.0, 2.0, 3.0]".
Another possibility that comes to mind is that the URL might not be correct.
When the path following Pinecone’s service domain (.svc.us-east1-gcp.pinecone.io) is not valid, an HTTP 200 OK with an empty Body appears to be returned. (This assumes that the Api-Key is correctly set). In this case, even if the value of the POST Body is an invalid string (text/plain), an HTTP 200 is still returned.
If the URL is correct and there is a problem with the Body, HTTP 400 should be returned.
You mentioned that the index update was successful, but can you confirm that the vectors have been added on the following screen as well?
Hello @dra
Thank you very much for your answer since it allowed me to fix the problem.
The issue was indeed related to the path following Pinecone’s service domain. The path was https://“my index name”.svc.eu-west1-gcp.pinecone.io/vectors/query instead of https://“my index name”.svc.eu-west1-gcp.pinecone.io/query