你能用 Postman / Curl 创建一个新的 Weaviate 系列吗?

问题描述 投票:0回答:1

我想要一个 Postman 路由来在 Weaviate 云上创建一个新集合。它可以是 REST 或 graphQL,不在乎。

有了图表,我可以像这样执行 GET:

{
  Get {
    Items {
      item_id
      description
    }
  }
}

我认为会是这样的,但这会出错

“message”:“不存在 graphql 提供程序,这很可能是因为不存在架构。首先导入架构!”

mutation {
  addClass(
    class: {
      class: "Items"
      properties: [
        {
          name: "entity_type"
          dataType: ["text"]
        }
        {
          name: "description"
          dataType: ["text"]
        }
        {
          name: "item_id"
          dataType: ["number"]
        }
      ]
    }
  ) {
    class {
      class
      properties {
        name
        dataType
      }
    }
  }
}
graphql postman weaviate
1个回答
0
投票

要创建新集合,请使用 schema 端点。例如:

curl --request POST \
  --url http://localhost:8080/v1/schema \
  --data '{
  "class": "",
  "vectorConfig": {
    "<vector_name>": {
      "vectorizer": "none",
      "vectorIndexType": "hnsw",
      "vectorIndexConfig": {}
    }
  },
  "vectorIndexType": "hnsw",
  "vectorIndexConfig": {},
  "shardingConfig": {
    "desiredCount": 1,
    "virtualPerPhysical": 128
  },
  "replicationConfig": {
    "factor": 1,
    "asyncEnabled": true
  },
  "invertedIndexConfig": {
    "cleanupIntervalSeconds": 60,
    "bm25": {
      "k1": 1.2,
      "b": 0.75
    },
    "stopwords": {
      "preset": "en",
      "additions": [],
      "removals": []
    },
    "indexTimestamps": false,
    "indexNullState": false,
    "indexPropertyLength": false
  },
  "multiTenancyConfig": {
    "enabled": false,
    "autoTenantCreation": true,
    "autoTenantActivation": true
  },
  "vectorizer": "none",
  "moduleConfig": {
    "<module_name>": {
      "vectorizeClassName": true
    }
  },
  "description": "",
  "properties": [
    {
      "dataType": [
        "string"
      ],
      "description": "",
      "moduleConfig": {
        "<module_name>": {
          "skip": false,
          "vectorizePropertyName": true
        }
      },
      "name": "",
      "indexInverted": true,
      "indexFilterable": true,
      "indexSearchable": true,
      "indexRangeFilters": true,
      "tokenization": "word",
      "nestedProperties": [
        {
          "name": "",
          "dataType": [
            "string"
          ],
          "description": "",
          "indexFilterable": true,
          "indexSearchable": true,
          "indexRangeFilters": true,
          "tokenization": "word",
          "nestedProperties": [
            "[Circular Reference]"
          ]
        }
      ]
    }
  ]
}'
© www.soinside.com 2019 - 2024. All rights reserved.