npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vendure-plugin-milvus

v2.2.0

Published

Milvus plugin for Vendure

Downloads

39

Readme

The vendure-plugin-milvus plugin provides powerful integration between Milvus, an open-source vector database built for scalable similarity search, and Vendure, a headless commerce framework. This plugin enables seamless management of Milvus collections, partitions, aliases, users, roles, databases, indexes, vectors, and data import directly from the Vendure admin interface.

Setup

The easiest way to set up a Milvus server is using the official docker image. You can run the following command to start a Milvus server:

curl -sfL https://raw.githubusercontent.com/milvus-io/milvus/master/scripts/standalone_embed.sh -o standalone_embed.sh

bash standalone_embed.sh start

https://milvus.io/docs/install_standalone-docker.md

Features

  • Milvus Collection Management: Create, update, list, describe, and delete collections.
  • Partition Management: Create, drop, list, load, and release partitions within collections.
  • Alias Management: Create, describe, drop, and alter aliases for collections.
  • Database Management: Create, describe, and list Milvus databases.
  • Index Management: Create, describe, list, and drop indexes on collections.
  • User and Role Management: Create, describe, list, update, and delete users and roles.
  • Vector Management: Insert, upsert, query, search, and delete vectors in collections.
  • Import Management: Create and manage import jobs for bulk data import.

Installation

To use this plugin, you need to have a running instance of Milvus. You can follow the Milvus installation guide for setting it up.

Install the plugin by running the following command:

npm install vendure-plugin-milvus

Usage

To add the Milvus plugin to your Vendure server, import and register the plugin in your Vendure configuration file:

import { MilvusPlugin } from 'vendure-plugin-milvus';

export const config: VendureConfig = {
  // ... other configuration options
  plugins: [
    // ... other plugins
    MilvusPlugin,
  ],
};

GraphQL API

The vendure-plugin-milvus exposes several GraphQL queries and mutations to interact with Milvus. Below is a summary of the available operations:

Collection Management

Queries

  • milvusListCollections
  • milvusDescribeCollection
  • milvusHasCollection
  • milvusGetCollectionStatistics
  • milvusGetCollectionLoadState

Mutations

  • milvusCreateCollection
  • milvusDropCollection
  • milvusRenameCollection
  • milvusLoadCollection
  • milvusReleaseCollection

Partition Management

Queries

  • milvusListPartitions
  • milvusHasPartition
  • milvusGetPartitionStatistics

Mutations

  • milvusCreatePartition
  • milvusDropPartition
  • milvusLoadPartitions
  • milvusReleasePartitions

Alias Management

Queries

  • milvusListAliases
  • milvusDescribeAlias

Mutations

  • milvusCreateAlias
  • milvusDropAlias
  • milvusAlterAlias

Database Management

Queries

  • milvusListDatabases
  • milvusDescribeDatabase

Mutations

  • milvusCreateDatabase
  • milvusDropDatabase

Index Management

Queries

  • milvusDescribeIndex
  • milvusListIndexes

Mutations

  • milvusCreateIndex
  • milvusDropIndex

User and Role Management

Queries

  • milvusDescribeUser
  • milvusListUsers
  • milvusDescribeRole
  • milvusListRoles

Mutations

  • milvusCreateUser
  • milvusDropUser
  • milvusUpdateUserPassword
  • milvusGrantRoleToUser
  • milvusRevokeRoleFromUser
  • milvusCreateRole
  • milvusDropRole
  • milvusGrantPrivilegeToRole
  • milvusRevokePrivilegeFromRole

Vector Management

Queries

  • milvusGetVector
  • milvusQueryVector
  • milvusSearchVector

Mutations

  • milvusInsertVector
  • milvusUpsertVector
  • milvusDeleteVector

Import Management

Queries

  • milvusListImportJobs
  • milvusGetImportJobProgress

Mutations

  • milvusCreateImportJob

Examples

Here are some example GraphQL queries and mutations to get you started with the vendure-plugin-milvus.

Create a Milvus Database

mutation {
  createMilvusDatabase(input: { name: "zikzakzikzakwtf" }) {
    error_code
    reason
    code
  }
}

List Collections

{
  milvusListCollections(params: {
    dbName: "zikzakzikzakwtf"
  }) {
    data
    message
  }
}

Create a Collection

mutation {
  milvusCreateCollection(
    data: {
      collectionName: "zikzaks",
      dbName: "zikzakzikzakwtf",
      schema: {
        autoID: false,
        enabledDynamicField: true,
        fields: [
          { fieldName: "id", dataType: "Int64", isPrimary: true },
          {
            fieldName: "barcode",
            dataType: "Int64",
            elementTypeParams: { max_length: 13 }
          },
          {
            fieldName: "name",
            dataType: "VarChar",
            elementTypeParams: { max_length: 256 }
          },
          {
            fieldName: "channel",
            dataType: "VarChar",
            elementTypeParams: { max_length: 32 }
          },
          {
            fieldName: "userId",
            dataType: "VarChar",
            elementTypeParams: { max_length: 64 }
          },
          {
            fieldName: "vector",
            dataType: "FloatVector",
            elementTypeParams: { dim: 768 }
          }
        ]
      },
      indexParams: {
        metricType: "L2"
        indexName: "zikzakIndex"
        fieldName: "vector"
        params: { index_type: "IVF_FLAT", nlist: 1024 }
      }
    }
  ) {
    data
    message
    code
  }
}

Drop a Collection

mutation {
  milvusDropCollection(data: {
    dbName: "zikzakzikzakwtf",
    collectionName: "zikzaks"
  }) {
    data
    code
    message
  }
}

List Indexes

{
  milvusListIndexes(
    params: { dbName: "zikzakzikzakwtf", collectionName: "zikzaks" }
  ) {
    data
    code
    message
  }
}

Create an Index

mutation {
  milvusCreateIndex(
    data: {
      dbName: "zikzakzikzakwtf",
      collectionName: "zikzaks",
      indexParams: {
        metricType: "L2",
        indexName: "zikzakIndex2",
        fieldName: "barcode",
        params: { index_type: "AUTOINDEX" }
      }
    }
  ) {
    code
    data
    message
  }
}

Drop an Index

mutation {
  milvusDropIndex(
    data: {
      dbName: "zikzakzikzakwtf",
      collectionName: "zikzaks",
      indexName: "zikzakIndex2"
    }
  ) {
    data
    message
    code
  }
}

Release a Collection

mutation {
  milvusReleaseCollection(
    data: { dbName: "zikzakzikzakwtf", collectionName: "zikzaks" }
  ) {
    data
    message
    code
  }
}

Load a Collection

mutation {
  milvusLoadCollection(
    data: { dbName: "zikzakzikzakwtf", collectionName: "zikzaks" }
  ) {
    code
    message
    data
  }
}

Describe a User

{
  milvusDescribeUser(params: {
    userName: "arrrrny"
  }) {
    data
    code
    message
  }
}

Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.