Skip to content

Show index type as text rather than numeric ID #5229

Description

@ribiza

When creating or showing an index, the output for the Kind field is a numeric ID of the type. As we did for collection fields, it's a nice UX improvement to display the corresponding string value there.

stef@carbonino:~$ defradb client collection add '
type Book11 {
  title: String
  plot: String @index(kind:ordered)
  about_v: [Float32!] @index(vector: {dimensions: 3, hnsw: {metric: COSINE}})  @embedding(
    fields: ["title", "plot"], 
    provider: "ollama", 
    model: "embeddinggemma"
  )
}
'
[
  {
    "Name": "Book11",
...
    "Indexes": [
      {
        "Name": "Book11_plot_ASC",
        "ID": 1,
        "Fields": [
          {
            "Name": "plot",
            "Descending": false
          }
        ],
        "Kind": 0,
        "KindDescription": {
          "Unique": false
        },
        "Unique": false
      },
      {
        "Name": "Book11_about_v_ASC",
        "ID": 2,
        "Fields": [
          {
            "Name": "about_v",
            "Descending": false
          }
        ],
        "Kind": 1,
        "KindDescription": {
          "Algorithm": "HNSW",
          "Metric": "COSINE",
          "Dimensions": 3,
          "HNSW": {
            "M": 16,
            "EfConstruction": 128,
            "EfSearch": 64
          }
        },
        "Unique": false
      }
    ],

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions