Get sort vector fix - DRAFT#101
Conversation
|
@sl-at-ibm Did you base this PR off an old version of the client? There's no other reason why your |
5a7165d to
90abad4
Compare
|
@toptobes You are very right - apologies. The simple mistake (sort vector sought in the wrong json path) was still there and this PR corrects it. But there's more, which is "fundamental" enough to warrant a closer look. I got to a working fix. I can get the sort vector if there are no results, if the cursor is closed (arguably useful), before any
I am not sure I have a good-enough grasp of the Go find cursor yet to do this autonomously, but let's talk! Incidentally, I did not commit a fix that Bob suggested to make sure I run my testing examples with the local code, i.e. adding |
|
Also an updated script |
This PR attempts to fix the missing result in GetSortVector for collections (and presumably table) finds.
As highlighted by working on
astra-vector-docs/modules/api-reference/examples/collections-find-many-sort-vector/example.go, the GetSortVector prints<nil>even though the response gives the sort vector. The reason is that the Go client looks for it underdata.sortVectorin the response, but it should look for it underresponse.sortVector.This is a Bob-aided attempt at fixing it. Now a simple script similar in spirit to the docs-example script returns indeed the sort vector, but in this form (not sure if it is the desired wrapping):
Here is a(n abridged) example response from the API:
And here is the silly script that incarnates the docs-example as a full runnable similar to the other
/exampleshere: ([attachment).getsortvectorer.go.txt
Note the go.mod/go.sum changes were by Bob helping me run the test script with the changed local code (it seems the v2 otherwise gets in the way and insists on using the codebase from github).