Hi, while creation a vector collection I used belo...
# community-help
k
Hi, while creation a vector collection I used below JSON body (as per https://typesense.org/docs/0.24.0/api/vector-search.html#nearest-neighbor-vector-search),
{
"name": "catalogue_items_vectors",
"fields": [
{"name": ".*", "type": "auto"},
{"name": "vec", "type": "float[]", "num_dim": 768}
]
}
now while going through with sample codes https://github.com/typesense/typesense-instantsearch-semantic-search-demo/tree/master I can see typesense-instantsearch-semantic-search-demo/scripts/vector-generation/main.py creating vector field like product['`vectors`'] = sentence_embeddings[0].tolist() I am little confuse which is typesense internally points ?
j
I am little confuse which is typesense internally points ?
Not sure I understand the question. Could you elaborate?
k
The first link shows to create a vector collection and named vector key as "vec", But the second link "main.py" inserting vector field named as "vector".
I believe typesense internally points to a key to find vector of that document. I am confused because two links creating vector with different string.
j
The vector can be named anything, as long as it has a
num_dim
property in the field definition. In the docs we’ve used the name
vec
as an example, and in the example we’ve used the word
vector
as the field name. You can rename it to any string
For eg, in this demo I just put together yesterday, I’ve named the field
embedding
k
Ohh great. got it. Thanks Jason Bosco.