Spaces:
Running
Running
ベクトルDBのQdrant設定
#4
by
terapyon
- opened
DBはQdrant Cloudを使う。
- collection_name: "gh-issues"
- 無料で使える範囲の小さなもの
ローカル開発
Docker 永続化なし
docker run -p 6333:6333 qdrant/qdrant
Docker 永続化
docker run -p 6333:6333 -v $(pwd)/qdrant_storage:/qdrant/storage qdrant/qdrant
データ挿入後のデータ確認
$ curl 'http://localhost:6333/collections/gh-issues'
{'result': {'config': {'hnsw_config': {'ef_construct': 100,
'full_scan_threshold': 10000,
'm': 16,
'max_indexing_threads': 0,
'on_disk': False},
'optimizer_config': {'default_segment_number': 0,
'deleted_threshold': 0.2,
'flush_interval_sec': 5,
'indexing_threshold': 20000,
'max_optimization_threads': 1,
'max_segment_size': None,
'memmap_threshold': None,
'vacuum_min_vector_number': 1000},
'params': {'on_disk_payload': True,
'replication_factor': 1,
'shard_number': 1,
'vectors': {'distance': 'Cosine',
'size': 1024},
'write_consistency_factor': 1},
'quantization_config': None,
'wal_config': {'wal_capacity_mb': 32,
'wal_segments_ahead': 0}},
'indexed_vectors_count': 0,
'optimizer_status': 'ok',
'payload_schema': {},
'points_count': 1484,
'segments_count': 8,
'status': 'green',
'vectors_count': 1484},
'status': 'ok',
'time': 0.000390544}
検索テスト
curl -L -X POST 'http://localhost:6333/collections/gh-issues/points/search' \
-H 'Content-Type: application/json' \
--data-raw '{
"vector": [0.2,0.1,0.9,0.7...............], # 1024次元必要
"limit": 3
}'
terapyon
changed discussion status to
closed