### Start Vearch Local Deployment using Shell Source: https://vearch.readthedocs.io/en/latest/quick-start-guide This command starts the Vearch service in a local deployment mode using a specified configuration file. It assumes the 'vearch' binary is executable and the configuration file (conf.toml) is present in the current directory. The 'all' argument indicates that all modules (master, ps, router) should be started. ```shell ./vearch -conf conf.toml all ``` -------------------------------- ### Start Vearch Partition Server (ps) Node using Shell Source: https://vearch.readthedocs.io/en/latest/quick-start-guide This command starts a Vearch partition server (ps) node on a specific machine. It requires the 'vearch' binary and a configuration file (config.toml). The 'ps' argument indicates that the partition server module should be started. ```shell ./vearch -conf config.toml ps ``` -------------------------------- ### Start Vearch Master Node using Shell Source: https://vearch.readthedocs.io/en/latest/quick-start-guide This command starts a Vearch master node on a specific machine. It requires the 'vearch' binary and a configuration file (config.toml). The 'master' argument specifies that the master module should be initiated. ```shell ./vearch -conf config.toml master ``` -------------------------------- ### Start Vearch Router Node using Shell Source: https://vearch.readthedocs.io/en/latest/quick-start-guide This command starts a Vearch router node on a specific machine. It requires the 'vearch' binary and a configuration file (config.toml). The 'router' argument specifies that the router module should be initiated. ```shell ./vearch -conf config.toml router ``` -------------------------------- ### GPU Index Configuration Example Source: https://vearch.readthedocs.io/en/latest/use_op/op_space Example configuration for a GPU index in Vearch. It specifies the index type as 'GPU' and provides parameters for the index, including metric_type, ncentroids, and nsubvector. ```json { "index_type": "GPU", "index_params": { "metric_type": "InnerProduct", "ncentroids": 2048, "nsubvector": 64 } } ``` -------------------------------- ### FLAT Index Configuration Example Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Example of configuring a FLAT index. This index type requires a 'metric_type' and supports 'MemoryOnly' storage. ```json { "index_type": "FLAT", "index_params": { "metric_type": "InnerProduct" } } ``` -------------------------------- ### BINARYIVF Index Configuration Example Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Example of configuring a BINARYIVF index. This index type requires 'ncentroids' and has a note about vector length being a multiple of 8. ```json { "index_type": "BINARYIVF", "index_params": { "ncentroids": 256 } } ``` -------------------------------- ### BINARYIVF Index Configuration Example Source: https://vearch.readthedocs.io/en/latest/use_op/op_space Example configuration for a BINARYIVF index in Vearch. This configuration specifies the index type and the number of centroids. BINARYIVF is optimized for memory usage and can be efficient for certain types of queries. ```json { "index_type": "BINARYIVF", "index_params": { "ncentroids": 256 } } ``` -------------------------------- ### IVFFLAT Index Configuration Example Source: https://vearch.readthedocs.io/en/latest/use_op/op_space Example configuration for an IVFFLAT index in Vearch. This configuration includes the index type, metric_type, and ncentroids. The IVFFLAT index is suitable for large datasets and offers a balance between recall and query speed. ```json { "index_type": "IVFFLAT", "index_params": { "metric_type": "InnerProduct", "ncentroids": 256 } } ``` -------------------------------- ### IVFFLAT Index Configuration Example Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Example of configuring an IVFFLAT index in Vearch. This index type uses a 'metric_type' and 'ncentroids' for indexing. ```json { "index_type": "IVFFLAT", "index_params": { "metric_type": "InnerProduct", "ncentroids": 256 } } ``` -------------------------------- ### FLAT Index Configuration Example Source: https://vearch.readthedocs.io/en/latest/use_op/op_space Example configuration for a FLAT index in Vearch. This is a simple index type that stores all vectors directly. It includes the index type and the metric_type. FLAT indexes are suitable for smaller datasets or when exact search is required. ```json { "index_type": "FLAT", "index_params": { "metric_type": "InnerProduct" } } ``` -------------------------------- ### GPU Index Configuration with IVFPQ Parameters Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Configuration example for GPU-based indexing using IVFPQ (Inverted File with Product Quantization). Specifies metric type for distance computation, number of centroids for clustering, and product quantization vector size. This example demonstrates typical settings for InnerProduct metric with 2048 centroids and 64-dimensional subvectors. ```json { "index_type": "GPU", "index_params": { "metric_type": "InnerProduct", "ncentroids": 2048, "nsubvector": 64 } } ``` -------------------------------- ### Vearch Search Query Example with Filters (curl) Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_doc An example using curl to perform a vector search in Vearch. It demonstrates setting vectors, complex filters with AND operator, index parameters, limit, database name, and space name. ```bash curl -H "content-type: application/json" -XPOST -d' { "vectors": [ { "field": "field_vector", "feature": [ "..." ] } ], "filters": { "operator": "AND", "conditions": [ { "field": "field_int", "operator": ">=", "value": 1 }, { "field": "field_int", "operator": "<=", "value": 3 }, { "field": "field_string", "operator": "IN", "value": [ "aaa", "bbb" ] } ] }, "index_params": { "metric_type": "L2" }, "limit": 3, "db_name": "ts_db", "space_name": "ts_space" }' ``` -------------------------------- ### Vearch IVFFLAT Index Parameters Source: https://vearch.readthedocs.io/en/latest/use_op/op_doc Example of index parameters for the IVFFLAT indexing method in Vearch. This configuration includes settings for parallel search, probe count, and metric type. ```json "index_params": { "parallel_on_queries": 1, "nprobe": 80, "metric_type": "L2" } ``` -------------------------------- ### GET /partitions Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_cluster Retrieves information about the partitions within the Vearch cluster. ```APIDOC ## GET /partitions ### Description Retrieves information about the partitions within the Vearch cluster. ### Method GET ### Endpoint /partitions ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **partitions** (array) - A list of partition objects, each containing partition details. #### Response Example ```json { "partitions": [ { "id": 1, "status": "active", "node_id": 1 } ] } ``` ``` -------------------------------- ### Vearch GPU Index Parameters Source: https://vearch.readthedocs.io/en/latest/use_op/op_doc Example of index parameters for GPU-accelerated search in Vearch. It specifies recall number, probe count, and the metric type for calculations. ```json "index_params": { "recall_num" : 100, "nprobe": 80, "metric_type": "L2" } ``` -------------------------------- ### GET /partitions Source: https://vearch.readthedocs.io/en/latest/use_op/op_cluster Retrieves the status of all partitions in the Vearch cluster. ```APIDOC ## GET /partitions ### Description Retrieves the status of all partitions in the Vearch cluster. ### Method GET ### Endpoint `http:///partitions` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **response** (object) - A JSON object detailing the status of each partition. ``` -------------------------------- ### Vearch IVFPQ Index Parameters Source: https://vearch.readthedocs.io/en/latest/use_op/op_doc Example of index parameters specifically for the IVFPQ model in Vearch. This includes settings for parallel search, recall number, probe count, and metric type. ```json "index_params": { "parallel_on_queries": 1, "recall_num" : 100, "nprobe": 80, "metric_type": "L2" } ``` -------------------------------- ### List Databases with cURL Source: https://vearch.readthedocs.io/en/latest/use_op/op_db This snippet demonstrates how to list all available databases in the Vearch service using a cURL GET request. It requires the Vearch service URL to be defined. ```shell curl -XGET http://${VEARCH_URL}/dbs ``` -------------------------------- ### Vearch FLAT Index Parameters Source: https://vearch.readthedocs.io/en/latest/use_op/op_doc Example of index parameters for the FLAT (exact search) index type in Vearch. This configuration primarily specifies the metric type used for calculations. ```json "index_params": { "metric_type": "L2" } ``` -------------------------------- ### Vearch Search Request with Curl Source: https://vearch.readthedocs.io/en/latest/use_op/op_doc Example of how to initiate a Vearch document search using curl. This demonstrates sending a POST request with a JSON payload containing vector data. ```bash curl -H "content-type: application/json" -XPOST -d' { "vectors": [ { "field": "field_vector", "feature": [ ``` -------------------------------- ### GET /dbs/{db_name}/spaces/{space_name}?detail=true Source: https://vearch.readthedocs.io/en/latest/use_op/op_space Retrieves detailed information about a space with comprehensive schema and configuration details. This endpoint includes all information from the basic endpoint plus extended details about field definitions and indexing strategies. ```APIDOC ## GET /dbs/{db_name}/spaces/{space_name}?detail=true ### Description Retrieve detailed information about a space including complete schema definitions, field types, indexing configuration, and partition details. ### Method GET ### Endpoint ``` http://${VEARCH_URL}/dbs/$db_name/spaces/$space_name?detail=true ``` ### Parameters #### Path Parameters - **db_name** (string) - Required - The name of the database containing the space - **space_name** (string) - Required - The name of the space to retrieve #### Query Parameters - **detail** (boolean) - Required - Set to true to retrieve detailed information including full schema definitions ### Request Example ```bash curl -XGET http://${VEARCH_URL}/dbs/ts_db/spaces/ts_space?detail=true ``` ### Response #### Success Response (200) - **code** (int) - Return code indicating success or failure - **msg** (string) - Optional return message - **data** (json) - Detailed space information object containing: - **space_name** (string) - Name of the space - **db_name** (string) - Name of the database - **doc_num** (uint64) - Number of documents in the space - **partition_num** (int) - Number of partitions - **replica_num** (int) - Number of replicas - **schema** (json) - Complete space schema with detailed field definitions including types, dimensions, and index configurations - **status** (string) - Space status (green indicates healthy, red indicates problems) - **partitions** (json) - Array of partition details with replica information, node assignment, and indexing status - **errors** (string list) - Optional array of error messages #### Response Example ```json { "code": 0, "data": { "space_name": "ts_space", "db_name": "ts_db", "doc_num": 0, "partition_num": 1, "replica_num": 3, "schema": { "fields": [ { "name": "field_string", "type": "string" }, { "name": "field_int", "type": "integer" }, { "name": "field_float", "type": "float", "index": { "name": "field_float", "type": "SCALAR" } }, { "name": "field_string_array", "type": "stringArray", "index": { "name": "field_string_array", "type": "SCALAR" } }, { "name": "field_int_index", "type": "integer", "index": { "name": "field_int_index", "type": "SCALAR" } }, { "name": "field_vector", "type": "vector", "dimension": 128, "index": { "name": "gamma", "type": "IVFPQ", "params": { "metric_type": "InnerProduct", "ncentroids": 2048, "nlinks": 32, "efConstruction": 40 } } } ] }, "status": "green", "partitions": [ { "pid": 1, "replica_num": 1, "status": 4, "color": "green", "ip": "x.x.x.x", "node_id": 1, "index_status": 0, "index_num": 0, "max_docid": -1 } ] } } ``` ``` -------------------------------- ### IVFPQ Index with HNSW Parameters Configuration Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space This example demonstrates configuring an IVFPQ index that also incorporates HNSW parameters. It includes settings for the metric type, centroids, subvectors, and HNSW-specific parameters like nlinks, efConstruction, and efSearch. ```json { "index_size": 2600000, "id_type": "string", "index_type": "IVFPQ", "index_params": { "metric_type": "InnerProduct", "ncentroids": 65536, "nsubvector": 64, "hnsw" : { "nlinks": 32, "efConstruction": 200, "efSearch": 64 } } } ``` -------------------------------- ### View Database Spaces with cURL Source: https://vearch.readthedocs.io/en/latest/use_op/op_db This snippet demonstrates how to view all spaces associated with a specific database in Vearch using a cURL GET request. The database name must be provided in the URL. This is useful for checking dependencies before database deletion. ```shell curl -XGET http://${VEARCH_URL}/dbs/$db_name/spaces ``` -------------------------------- ### Compile Vearch Binary using Shell Script Source: https://vearch.readthedocs.io/en/latest/quick-start-guide This shell script compiles the Vearch binary. It requires a Linux-like environment with specific dependencies like Go and GCC. The script navigates to the build directory and executes 'build.sh' to generate the 'vearch' executable. Options to enable GPU and Scann index support can be configured in CMakeLists.txt. ```shell cd build sh build.sh ``` -------------------------------- ### Vearch Configuration for Local Deployment (TOML) Source: https://vearch.readthedocs.io/en/latest/quick-start-guide This TOML configuration file defines settings for a single-node Vearch deployment. It includes global parameters like cluster name, data and log paths, and security settings. Specific configurations for master, router, and partition server (ps) modules are also defined, including network ports and Raft protocol parameters. ```toml [global] # the name will validate join cluster by same name name = "vearch" # your data save to disk path ,If you are in a production environment, You'd better set absolute paths data = ["datas/"] # log path , If you are in a production environment, You'd better set absolute paths log = "logs/" # default log type for any model level = "debug" # master <-> ps <-> router will use this key to send or receive data signkey = "vearch" skip_auth = true # if you are master you'd better set all config for router and ps and router and ps use default config it so cool [[masters]] # name machine name for cluster name = "m1" # ip or domain address = "127.0.0.1" # api port for http server api_port = 8817 # port for etcd server etcd_port = 2378 # listen_peer_urls List of comma separated URLs to listen on for peer traffic. # advertise_peer_urls List of this member's peer URLs to advertise to the rest of the cluster. The URLs needed to be a comma-separated list. etcd_peer_port = 2390 # List of this member's client URLs to advertise to the public. # The URLs needed to be a comma-separated list. # advertise_client_urls AND listen_client_urls etcd_client_port = 2370 [router] # port for server port = 9001 [ps] # port for server rpc_port = 8081 # raft config begin raft_heartbeat_port = 8898 raft_replicate_port = 8899 heartbeat-interval = 200 #ms raft_retain_logs = 10000 raft_replica_concurrency = 1 raft_snap_concurrency = 1 ``` -------------------------------- ### View Space - Basic Query with curl Source: https://vearch.readthedocs.io/en/latest/use_op/op_space Retrieves basic space information including name, database name, document count, partition count, replica count, schema, and status. This is the standard endpoint for viewing space details without additional parameters. ```bash curl -XGET http://${VEARCH_URL}/dbs/$db_name/spaces/$space_name ``` -------------------------------- ### GET /cluster/health Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_cluster Retrieves the health status of the Vearch cluster. ```APIDOC ## GET /cluster/health ### Description Retrieves the health status of the Vearch cluster. ### Method GET ### Endpoint /cluster/health ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **health** (string) - The health status of the cluster (e.g., "green", "yellow", "red"). #### Response Example ```json { "health": "green" } ``` ``` -------------------------------- ### BINARYIVF Index Configuration Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Configuration parameters for the BINARYIVF index type, focusing on the number of buckets and training data requirements. ```APIDOC ## BINARYIVF Index Configuration ### Description Configuration parameters for the BINARYIVF index type. This includes the number of buckets for indexing, the training data threshold, and retrieval parameters. ### Index Type `BINARYIVF` ### Index Parameters #### ncentroids - **Type**: `int` - **Required**: `true` - **Description**: The number of buckets for indexing. - **Default**: `256` #### training_threshold - **Type**: `int` - **Required**: `false` - **Description**: The minimum amount of data required for each shard to begin training. The default is `ncentroids * 39`. #### nprobe - **Type**: `int` - **Required**: `false` - **Description**: The number of cluster centers to check during retrieval. - **Default**: `80` ### Notes 1. The vector length must be a multiple of 8. ``` -------------------------------- ### GET /servers Source: https://vearch.readthedocs.io/en/latest/use_op/op_cluster Lists the status of all servers within the Vearch cluster. ```APIDOC ## GET /servers ### Description Lists the status of all servers within the Vearch cluster. ### Method GET ### Endpoint `http:///servers` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **response** (object) - A JSON object containing the status of each server. ``` -------------------------------- ### View Space - Detailed Response Format with JSON Source: https://vearch.readthedocs.io/en/latest/use_op/op_space Extended JSON response format returned when using the detail=true query parameter. Includes all basic space information plus comprehensive partition replica details, providing deeper visibility into space distribution and indexing status. ```json { "code": 0, "data": { "space_name": "ts_space", "db_name": "ts_db", "doc_num": 0, "partition_num": 1, "replica_num": 3, "schema": { "fields": [ { "name": "field_string", "type": "string" }, { "name": "field_int", "type": "integer" }, { "name": "field_float", "type": "float", "index": { "name": "field_float", "type": "SCALAR" } }, { "name": "field_string_array", "type": "stringArray", "index": { "name": "field_string_array", "type": "SCALAR" } }, { "name": "field_int_index", "type": "integer", "index": { "name": "field_int_index", "type": "SCALAR" } } ] } } } ``` -------------------------------- ### GET /cluster/health Source: https://vearch.readthedocs.io/en/latest/use_op/op_cluster Checks the overall health status of the Vearch cluster. ```APIDOC ## GET /cluster/health ### Description Checks the overall health status of the Vearch cluster. ### Method GET ### Endpoint `http:///cluster/health` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **response** (object) - A JSON object indicating the cluster's health status. ``` -------------------------------- ### GET /cluster/stats Source: https://vearch.readthedocs.io/en/latest/use_op/op_cluster Retrieves comprehensive statistics for the entire Vearch cluster. ```APIDOC ## GET /cluster/stats ### Description Retrieves comprehensive statistics for the entire Vearch cluster. ### Method GET ### Endpoint `http:///cluster/stats` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **response** (object) - A JSON object containing cluster statistics. ``` -------------------------------- ### GET /servers Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_cluster Retrieves a list of active servers within the Vearch cluster. ```APIDOC ## GET /servers ### Description Retrieves a list of active servers within the Vearch cluster. ### Method GET ### Endpoint /servers ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **servers** (array) - A list of server objects, each containing server details. #### Response Example ```json { "servers": [ { "id": "server-1", "ip": "192.168.1.100", "port": 9000 } ] } ``` ``` -------------------------------- ### Vearch Configuration for Cluster Deployment (TOML) Source: https://vearch.readthedocs.io/en/latest/quick-start-guide This TOML configuration file is designed for a Vearch cluster deployment across multiple machines. It defines parameters for multiple master nodes, router, and partition servers (ps). Each master node is configured with its address and etcd ports. Global settings remain similar to the local deployment, with a different log level ('info'). ```toml [global] name = "vearch" data = ["datas/"] log = "logs/" level = "info" signkey = "vearch" skip_auth = true # if you are master, you'd better set all config for router、ps and router, ps use default config it so cool [[masters]] name = "m1" address = "192.168.1.1" api_port = 8817 etcd_port = 2378 etcd_peer_port = 2390 etcd_client_port = 2370 [[masters]] name = "m2" address = "192.168.1.2" api_port = 8817 etcd_port = 2378 etcd_peer_port = 2390 etcd_client_port = 2370 [router] port = 9001 skip_auth = true [ps] rpc_port = 8081 raft_heartbeat_port = 8898 raft_replicate_port = 8899 heartbeat-interval = 200 #ms raft_retain_logs = 10000 raft_replica_concurrency = 1 raft_snap_concurrency = 1 ``` -------------------------------- ### GET /cluster/stats Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_cluster Retrieves statistics about the Vearch cluster's overall status and performance. ```APIDOC ## GET /cluster/stats ### Description Retrieves statistics about the Vearch cluster's overall status and performance. ### Method GET ### Endpoint /cluster/stats ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **stats** (object) - Contains various cluster statistics. #### Response Example ```json { "stats": { "cluster_name": "vearch_cluster", "status": "green", "indices": { "count": 1, "docs": { "count": 1000 } } } } ``` ``` -------------------------------- ### Get Alias Details Source: https://vearch.readthedocs.io/en/latest/use_op/op_alias Retrieves the details of a specific space alias, including the space and database it is associated with. ```APIDOC ## GET /alias/{alias_name} ### Description Retrieves the details of a specific space alias, including the space and database it is associated with. ### Method GET ### Endpoint /alias/$alias_name ### Parameters #### Path Parameters - **alias_name** (string) - Required - The name of the alias to retrieve details for. ### Request Example ```bash curl -XGET http://${VEARCH_URL}/alias/$alias_name ``` ### Response #### Success Response (200) (Details of success response not provided in the source text) #### Response Example (No example provided in the source text) ``` -------------------------------- ### Vearch IVFPQ Index Parameters Source: https://vearch.readthedocs.io/en/latest/use_op/op_space This JSON snippet defines the parameters for an IVFPQ (Inverted File with Product Quantization) index in Vearch. It includes essential configurations like metric type, number of centroids, and sub-vector size, crucial for optimizing vector search performance. ```json { "index_type": "IVFPQ", "index_params": { "metric_type": "InnerProduct", "ncentroids": 2048, "nsubvector": 64 } } ``` -------------------------------- ### GET /dbs Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_db Retrieves a list of all databases in the Vearch service. This endpoint allows you to view all currently created databases. ```APIDOC ## GET /dbs ### Description List all databases in the Vearch service. ### Method GET ### Endpoint ``` http://${VEARCH_URL}/dbs ``` ### Parameters None ### Request Example ```bash curl -XGET http://${VEARCH_URL}/dbs ``` ### Response #### Success Response (200) - **databases** (array) - List of database objects #### Response Example ```json { "databases": [] } ``` ``` -------------------------------- ### Create Vearch Space using Curl Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space This snippet demonstrates how to create a new space in Vearch using a POST request with `curl`. It includes the necessary JSON payload to define the space's name, partitioning, replication, fields, and indexing parameters. The example assumes VEARCH_URL and db_name are pre-configured environment variables. ```shell curl -XPOST -H "content-type: application/json" -d' { "name": "space1", "partition_num": 1, "replica_num": 3, "fields": [ { "name": "field_string", "type": "string" }, { "name": "field_int", "type": "integer" }, { "name": "field_float", "type": "float", "index": { "name": "field_float", "type": "SCALAR" } }, { "name": "field_string_array", "type": "stringArray", "index": { "name": "field_string_array", "type": "SCALAR" } }, { "name": "field_int_index", "type": "integer", "index": { "name": "field_int_index", "type": "SCALAR" } }, { "name": "field_vector", "type": "vector", "dimension": 128, "index": { "name": "gamma", "type": "IVFPQ", "params": { "metric_type": "InnerProduct", "ncentroids": 2048, "nlinks": 32, "efConstruction": 40 } } } ] }' http://${VEARCH_URL}/dbs/$db_name/spaces ``` -------------------------------- ### GET /clean_lock Source: https://vearch.readthedocs.io/en/latest/use_op/op_cluster Manually clears a cluster lock. This is useful if a table creation process was interrupted and the lock was not released. ```APIDOC ## GET /clean_lock ### Description Manually clears a cluster lock. This is useful if a table creation process was interrupted and the lock was not released. ### Method GET ### Endpoint `http:///clean_lock` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **response** (object) - A JSON object confirming the lock has been cleared or indicating its status. ``` -------------------------------- ### Vearch Space Response Format with Schema and Partitions Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Complete JSON response structure from Vearch space API showing space configuration, field schema with vector and scalar indexes, partition distribution across nodes, and cluster health status. Includes IVFPQ vector index configuration with metric types and parameters. ```json { "code": 0, "data": { "space_name": "ts_space", "db_name": "ts_db", "doc_num": 0, "partition_num": 1, "replica_num": 3, "schema": { "fields": [ { "name": "field_string", "type": "string" }, { "name": "field_int", "type": "integer" }, { "name": "field_float", "type": "float", "index": { "name": "field_float", "type": "SCALAR" } }, { "name": "field_string_array", "type": "stringArray", "index": { "name": "field_string_array", "type": "SCALAR" } }, { "name": "field_int_index", "type": "integer", "index": { "name": "field_int_index", "type": "SCALAR" } }, { "name": "field_vector", "type": "vector", "dimension": 128, "index": { "name": "gamma", "type": "IVFPQ", "params": { "metric_type": "InnerProduct", "ncentroids": 2048, "nlinks": 32, "efConstruction": 40 } } } ] }, "status": "green", "partitions": [ { "pid": 1, "replica_num": 1, "status": 4, "color": "green", "ip": "x.x.x.x", "node_id": 1, "index_status": 0, "index_num": 0, "max_docid": -1 }, { "pid": 2, "replica_num": 1, "status": 4, "color": "green", "ip": "x.x.x.x", "node_id": 2, "index_status": 0, "index_num": 0, "max_docid": -1 }, { "pid": 3, "replica_num": 1, "status": 4, "color": "green", "ip": "x.x.x.x", "node_id": 3, "index_status": 0, "index_num": 0, "max_docid": -1 } ] } } ``` -------------------------------- ### GET /dbs/{db_name} Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_db Retrieves detailed information about a specific database. Use the database name as a path parameter to view its properties. ```APIDOC ## GET /dbs/{db_name} ### Description View detailed information about a specific database. ### Method GET ### Endpoint ``` http://${VEARCH_URL}/dbs/$db_name ``` ### Parameters #### Path Parameters - **db_name** (string) - Required - The name of the database to view ### Request Example ```bash curl -XGET http://${VEARCH_URL}/dbs/$db_name ``` ### Response #### Success Response (200) - **name** (string) - Database name - **properties** (object) - Database properties #### Response Example ```json { "name": "$db_name", "properties": {} } ``` ``` -------------------------------- ### GET /dbs/{db_name} Source: https://vearch.readthedocs.io/en/latest/use_op/op_db Retrieves detailed information about a specific database. Returns the database configuration and metadata for the specified database name. ```APIDOC ## GET /dbs/{db_name} ### Description Retrieves detailed information about a specific database including its configuration and metadata. ### Method GET ### Endpoint http://${VEARCH_URL}/dbs/$db_name ### Parameters #### Path Parameters - **db_name** (string) - Required - The name of the database to retrieve ### Request Example ``` curl -XGET http://${VEARCH_URL}/dbs/$db_name ``` ### Response #### Success Response (200) Returns the database object with detailed information. #### Response Fields - **name** (string) - Database name - **config** (object) - Database configuration details ``` -------------------------------- ### GET /dbs Source: https://vearch.readthedocs.io/en/latest/use_op/op_db Retrieves a list of all databases in the Vearch service. This endpoint allows users to view all available databases without any parameters. ```APIDOC ## GET /dbs ### Description Retrieves a list of all databases in the Vearch service. ### Method GET ### Endpoint http://${VEARCH_URL}/dbs ### Parameters None ### Request Example ``` curl -XGET http://${VEARCH_URL}/dbs ``` ### Response #### Success Response (200) Returns an array of database objects containing database information. #### Response Fields - **databases** (array) - List of database objects ``` -------------------------------- ### Vearch GPU Index Parameters Source: https://vearch.readthedocs.io/en/latest/use_op/op_space This JSON snippet outlines the parameters for configuring a GPU-accelerated index in Vearch. It specifies the metric type, number of centroids, and sub-vector size, essential for leveraging GPU hardware for faster vector indexing and searching. ```json { "index_type": "GPU", "index_params": { "metric_type": "L2", "ncentroids": 2048, "nsubvector": 64 } } ``` -------------------------------- ### POST /dbs/{db_name} Source: https://vearch.readthedocs.io/en/latest/use_op/op_db Creates a new database with the specified name in the Vearch service. Requires the database name as a path parameter. ```APIDOC ## POST /dbs/{db_name} ### Description Creates a new database with the specified name in the Vearch service. ### Method POST ### Endpoint http://${VEARCH_URL}/dbs/$db_name ### Parameters #### Path Parameters - **db_name** (string) - Required - The name of the database to create ### Request Example ``` curl -XPOST http://${VEARCH_URL}/dbs/$db_name ``` ### Response #### Success Response (200) Database created successfully. #### Response Fields - **status** (string) - Status of the operation ``` -------------------------------- ### GET /dbs/{db_name}/spaces Source: https://vearch.readthedocs.io/en/latest/use_op/op_db Retrieves a list of all table spaces associated with a specific database. Returns information about all spaces within the database. ```APIDOC ## GET /dbs/{db_name}/spaces ### Description Retrieves a list of all table spaces associated with a specific database. ### Method GET ### Endpoint http://${VEARCH_URL}/dbs/$db_name/spaces ### Parameters #### Path Parameters - **db_name** (string) - Required - The name of the database to retrieve spaces from ### Request Example ``` curl -XGET http://${VEARCH_URL}/dbs/$db_name/spaces ``` ### Response #### Success Response (200) Returns an array of table space objects. #### Response Fields - **spaces** (array) - List of table space objects in the database ``` -------------------------------- ### GET /dbs/{db_name}/spaces Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_db Retrieves a list of all table spaces within a specific database. This endpoint shows all spaces available under the specified database. ```APIDOC ## GET /dbs/{db_name}/spaces ### Description View all table spaces within a specific database. ### Method GET ### Endpoint ``` http://${VEARCH_URL}/dbs/$db_name/spaces ``` ### Parameters #### Path Parameters - **db_name** (string) - Required - The name of the database ### Request Example ```bash curl -XGET http://${VEARCH_URL}/dbs/$db_name/spaces ``` ### Response #### Success Response (200) - **spaces** (array) - List of table space objects in the database #### Response Example ```json { "spaces": [] } ``` ``` -------------------------------- ### GET /clean_lock Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_cluster Manually clears the cluster lock, which is typically acquired during table creation. This is useful if the service becomes abnormal and the lock is not released automatically. ```APIDOC ## GET /clean_lock ### Description Manually clears the cluster lock, which is typically acquired during table creation. This is useful if the service becomes abnormal and the lock is not released automatically. ### Method GET ### Endpoint /clean_lock ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **message** (string) - A message indicating the success of clearing the lock. #### Response Example ```json { "message": "Cluster lock cleared successfully." } ``` ``` -------------------------------- ### IVFFLAT Index Configuration Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Configuration parameters for the IVFFLAT index type, including retrieval parameters and index-specific settings. ```APIDOC ## IVFFLAT Index Configuration ### Description Configuration parameters for the IVFFLAT index type. This includes settings related to the number of cluster centers during retrieval and general index parameters. ### Index Type `IVFFLAT` ### Index Parameters #### nprobe - **Type**: `int` - **Required**: `false` - **Description**: The number of cluster centers to check during retrieval. - **Default**: `80` #### index_params - **metric_type** (string) - Required - The type of metric to use (e.g., `InnerProduct`). - **ncentroids** (int) - Required - The number of centroids for indexing. ``` -------------------------------- ### GET /dbs/{db_name}/spaces/{space_name} Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_space Retrieves detailed information about a specific space within a database. This includes schema, partition status, and replica information. ```APIDOC ## GET /dbs/{db_name}/spaces/{space_name} ### Description Retrieves detailed information about a specific space within a database. This includes schema, partition status, and replica information. ### Method GET ### Endpoint /dbs/{db_name}/spaces/{space_name}?detail=true ### Parameters #### Query Parameters - **detail** (boolean) - Optional - If true, returns detailed information about the space. ### Request Example ```bash curl -XGET http://${VEARCH_URL}/dbs/ts_db/spaces/ts_space?detail=true ``` ### Response #### Success Response (200) - **code** (integer) - Indicates the success of the operation (0 for success). - **data** (object) - Contains the space details. - **space_name** (string) - The name of the space. - **db_name** (string) - The name of the database the space belongs to. - **doc_num** (integer) - The number of documents in the space. - **partition_num** (integer) - The number of partitions in the space. - **replica_num** (integer) - The number of replicas for each partition. - **schema** (object) - Defines the structure of the documents in the space. - **fields** (array) - An array of field definitions. - **name** (string) - The name of the field. - **type** (string) - The data type of the field (e.g., 'string', 'integer', 'float', 'vector'). - **index** (object, optional) - Indexing configuration for the field. - **name** (string) - The name of the index. - **type** (string) - The type of the index (e.g., 'SCALAR', 'IVFPQ'). - **params** (object, optional) - Parameters specific to the index type. - **dimension** (integer, optional) - The dimension of the vector field. - **status** (string) - The overall status of the space (e.g., 'green'). - **partitions** (array) - An array of partition objects, each containing details like pid, replica_num, status, ip, node_id, etc. #### Response Example ```json { "code": 0, "data": { "space_name": "ts_space", "db_name": "ts_db", "doc_num": 0, "partition_num": 1, "replica_num": 3, "schema": { "fields": [ { "name": "field_string", "type": "string" }, { "name": "field_int", "type": "integer" }, { "name": "field_float", "type": "float", "index": { "name": "field_float", "type": "SCALAR" } }, { "name": "field_string_array", "type": "stringArray", "index": { "name": "field_string_array", "type": "SCALAR" } }, { "name": "field_int_index", "type": "integer", "index": { "name": "field_int_index", "type": "SCALAR" } }, { "name": "field_vector", "type": "vector", "dimension": 128, "index": { "name": "gamma", "type": "IVFPQ", "params": { "metric_type": "InnerProduct", "ncentroids": 2048, "nlinks": 32, "efConstruction": 40 } } } ] }, "status": "green", "partitions": [ { "pid": 1, "replica_num": 1, "status": 4, "color": "green", "ip": "x.x.x.x", "node_id": 1, "index_status": 0, "index_num": 0, "max_docid": -1 }, { "pid": 2, "replica_num": 1, "status": 4, "color": "green", "ip": "x.x.x.x", "node_id": 2, "index_status": 0, "index_num": 0, "max_docid": -1 }, { "pid": 3, "replica_num": 1, "status": 4, "color": "green", "ip": "x.x.x.x", "node_id": 3, "index_status": 0, "index_num": 0, "max_docid": -1 } ] } } ``` ``` -------------------------------- ### Backup Vearch Space to S3 Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_backup_migrate Initiates a backup of a specified Vearch database space to S3 remote storage. Requires S3 credentials and endpoint configuration. The 'with_schema' flag determines if table information is included in the backup. ```curl curl --location 'http://${VEARCH_URL}/backup/dbs/${DB_NAME}/spaces/${SPACE_NAME}' \ --data '{ \ "command": "create", \ "with_schema": true, \ "s3_param": { \ "access_key": "USER_ACCESS_KEY", \ "bucket_name": "USER_BUCKET_NAME", \ "endpoint": "S3_ENDPOINT", \ "secret_key": "USER_SECRET", \ "use_ssl": true \ } \ }' ``` -------------------------------- ### List Vearch Databases (curl) Source: https://vearch.readthedocs.io/en/latest/_sources/use_op/op_db Retrieves a list of all databases available in the Vearch instance. This command requires only the Vearch URL and makes a GET request to the /dbs endpoint. ```curl curl -XGET http://${VEARCH_URL}/dbs ```