Updated on 2024-11-29 GMT+08:00

Importing a Vector

When writing vector data to the my_index index, you need ti specify the vector name and vector data.

Input vector data can be floating-point arrays separated by commas (,) and Base64 strings encoded using little-endian. When the vector has a large number of valid bits, the Base64 encoding format is more efficient for data transmission and parsing. Bulk operations are recommended when a large amount of data needs to be written.

The following is an example of inserting a floating-point array separated by commas (,):

POST my_index/_doc 
 { 
   "my_vector": [1.0, 2.0] 
 }  

The following is an example of inserting a Base64 string encoded using little-endian:

POST my_index/_doc 
 { 
   "my_vector": "AACAPwAAAEA=" 
 }