[Milvus] Collection
์ด์ ํฌ์คํธ
https://blog.naver.com/sssang97/223842124097
์ปฌ๋ ์ ์ Mivus์ ๊ธฐ๋ณธ ํ ์ด๋ธ ๋จ์๋ค.
์ปฌ๋ ์ ์ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ณ ์ ID์, ์ฌ์ ์ ์ ์๋ ์ฌ๋ฌ ํ๋๋ค๋ก ๊ตฌ์ฑ๋ ์ ์๋ค.
๋ฒกํฐ ๊ฐ๋ ์ผ๋ฐ์ ์ธ ํ๋ ์ค ํ๋๋ก ๋ค์ด๊ฐ ์ ์๋ค.
๋ฒกํฐ๋ฅผ ํฌํจํ ํ๋๋ค์ ๋ํ ์ธ๋ฑ์ค๋ ๋ช
์์ ์ผ๋ก ์ง์ ํด์ผ ํ๋ค. ์๋์ผ๋ก ์ธ๋ฑ์ค๊ฐ ๊ฑธ๋ฆฌ๋ ๊ตฌ์กฐ๋ ์๋๋ค.
์ปฌ๋ ์ ์์ฑ
์์ฑ์ ์ ์ฉ create API๋ฅผ ํตํด์ ์ํํ ์ ์๋ค.
๋ฐ๋์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ ํจ๊ป ์ง์ ํด์ผ ํ๊ณ , ๋ฒกํฐ ์ฐจ์๋ ์ง์ ํด์ค์ผ ํ๋ค.
###
POST http://{{HOST}}:{{PORT}}/v2/vectordb/collections/create
Content-Type: application/json
{
"dbName": "test_db",
"collectionName": "test_collection",
"dimension": 8
}
###
GRPC ๋ฑ์ ์ฐ๋ฉด ๋ฒกํฐ๋ฅผ ์ฌ๋ฌ๊ฐ ๋ง๋ ๋ค๊ฑฐ๋, ๋ฒกํฐ ํ์
์ ์ง์ ํ๋ค๊ฑฐ๋ ํ๋๊ฒ ๋๋ ๊ฒ ๊ฐ์ง๋ง, HTTP๋ ๊ธฐ๋ฅ์ ์ ํ์ด ์๋ ๊ฒ ๊ฐ๋ค.
์ปฌ๋ ์ ์ ๋ณด ์กฐํ
๋ชฉ๋ก ์กฐํ๋ list๋ก ์กฐํํ ์ ์๋ค. ๋ง์ฐฌ๊ฐ์ง๋ก db๋ฅผ ์ง์ ํด์ผ ํ๋ค.
###
POST http://{{HOST}}:{{PORT}}/v2/vectordb/collections/list
Content-Type: application/json
{
"dbName": "test_db"
}
###

์์ธ ์กฐํ๋ describe API๋ฅผ ์ฐ๋ฉด ๋๋ค.
db ์ด๋ฆ์ ์ปฌ๋ ์
์ด๋ฆ์ ๋ชจ๋ ์ ๋ฌ๋ฐ๋๋ค.
###
POST http://{{HOST}}:{{PORT}}/v2/vectordb/collections/describe
Content-Type: application/json
{
"dbName": "test_db",
"collectionName": "test_collection"
}
###
๊ทธ๋ผ ์ด๋ฐ ์์ผ๋ก ์ปฌ๋ ์
์ ๋ํ ์ ์ฒด ์ ๋ณด๋ฅผ ๋ฟ๋ ค์ค๋ค.
๊ทธ๋ผ ์ด๋ฐ์์ผ๋ก ์๋ ์์ฑ๋ ํ๋๋ ๋ค์ด์๋ค.
id๊ฐ ์ ์ ๊ธฐ๋ณธํค๊ณ , vector๊ฐ ๋ฒกํฐ ํ๋๋ค.
์ฐธ์กฐ
https://milvus.io/docs/manage-collections.md
https://milvus.io/api-reference/restful/v2.5.x/v2/Collection%20(v2)/Create.md