pgvector-java icon indicating copy to clipboard operation
pgvector-java copied to clipboard

How about adding comments for the constructors (Map<Integer, T> map, int dimensions) and (String s) of PGsparsevec?

Open cho-thinkfree-com opened this issue 1 year ago • 0 comments

Hello,

For the (String s) constructor of PGsparsevec, it follows the same format as pgvector, so the index starts from 1. However, for the constructor with the parameters (Map<Integer, T> map, int dimensions), it seems that the values in the Map start with the common array index of 0.

While the (String s) constructor has a comment stating text representation of a sparse vector, which helps users understand, the PGsparsevec(Map<Integer, T> map, int dimensions) constructor lacks any such explanation, which might lead to confusion. (I also misunderstood and added values by adding +1 to the zero-based index, following the pgvector method.)

Since it has already been released, I believe it would be difficult to change the base index. I would like to carefully suggest adding more explicit comments for the benefit of the library users.

cho-thinkfree-com avatar Sep 17 '24 14:09 cho-thinkfree-com