Skip to content

Latest commit

 

History

History
72 lines (59 loc) · 1.19 KB

README.md

File metadata and controls

72 lines (59 loc) · 1.19 KB

Vearch Python Client

MASTER address is 127.0.0.1, MASTER api_port is 8817,ROUTER address is 127.0.0.1,ROUTER port is 9001, ROUTER rpc_port is 9002.

Create DB

# request
curl -H "content-type: application/json" -XPUT -d'
{
	"name":"ts_db"
}
' {{MASTER}}/db/_create

Create Space

curl -H "content-type: application/json" -XPUT -d'
{
	"name": "ts_space",
	"partition_num": 1,
	"replica_num": 1,
	"engine": {
		"name": "gamma",
		"index_size": 10000,
		"id_type": "string",
		"retrieval_type": "IVFPQ",
		"retrieval_param": {
			"metric_type":"InnerProduct",
			"ncentroids": 2048,
			"nsubvector": 32
		}
	},
	"properties": {
		"field1": {
			"type": "string",
			"index": true
		},
		"field2": {
			"type": "string",
			"index": true
		},
		"field3": {
			"type": "integer",
			"index": true
		},
		"vector": {
			"type": "vector",
			"dimension": 128,
			"store_type": "MemoryOnly",
			"format": "normalization"
		}
	}
}
' {{MASTER}}/space/test_vector_db/_create

Run

pip install -r requirements.txt
bash generate_python.sh

Demo

test_client.py