Hyperspace Docs
Hyperspace Homepage
  • Getting started
    • Overview
      • Hyperspace Advantages
      • Hyperspace Search
    • Quick Start
  • flows
    • Setting Up
      • Installing the Hyperspace API Client
      • Connecting to the Hyperspace Server
      • Creating a Database Schema Configuration File
        • Vector Similarity Metrics
        • Index Type Methods
      • Creating a Collection
      • Uploading Data to a Collection
      • Building and Running Queries
        • Building a Lexical Search Query
        • Building a Vector Search Query
        • Building a Hybrid Search Query
      • Retrieving Results
    • Data Collections
      • Uploading Data
      • Accessing Data
      • Supported Data Types
    • Queries
      • DSL Query interface
        • Aggregations
        • Bool Query
        • Candidate Generation and Metadata Filtering
        • Scoring and Ranking
  • Reference
    • Hyperspace Query Flow
    • Features and Benefits
    • Search Processing Unit (SPU)
    • Hyperspace Document Prototype
  • API Documentation
    • Hyperspace Client
      • add_batch
      • add_document
      • async_req
      • clear_collection
      • collections_info
      • commit
      • create_collection
      • delete_collection
      • delete_by_query
      • dsl_search
      • get_schema
      • get_document
      • reset_password
      • search
      • update_by_query
      • update_document
    • DSL Query Framework
      • Aggregations
        • Cardinality Aggregation
        • Date Histogram
        • Metric Aggregations
        • Terms Aggregation
      • Bool Queries
        • Free Text Search
        • 'match' Clause
        • 'filter' Clause
        • 'must' Clause
        • 'must_not' Clause
        • 'should' Clause
        • 'should_not' Clause
      • Candidate Generation and Metadata Filtering
        • Geo Coordinates Match
        • Range Match
        • Term Match
      • Scoring and Ranking
        • Boost
        • 'dis_max'
        • Function Score
        • Rarity Score (TF-IDF)
  • Releases
    • 2024 Releases
Powered by GitBook
On this page
  1. flows

Data Collections

The Hyperspace database stores data under Collections, which are distinct segments within the database. Before using the following commands, you must establish a local Hyperspace instance in order to allocate the essential resources and functions.

  • Creating a Collection

  • Committing a Collection

  • Deleting a Collection

  • Clearing a Collection

  • Getting a Collection Scheme

Creating a Collection

The following command creates a Collection.

hyperspace_client.create_collection('schema.json', collection_name')
hyperspaceClient.createCollection('schema.json', collection_name');
await hyperspaceClient.createCollection('schema.json', collection_name');

Where –

  • schema.json – Specifies the path to the configuration file (for example, \schema.json) that you created locally on your machine, as described in Creating a Database Schema Configuration File.

  • collection_name – Specifies the name of the Collection to be created in the Hyperspace database. You can specify any name as long as it is unique to your Hyperspace Collection.

Response

The following response should be received –

{'status': 'OK', 'code': 200, 'message': 'Collection was successfully created'}

Committing a Collection

After you upload the data, it is required that you commit it, by running the following command to initiate the process of Hyperspace automatically backing up uploaded data periodically. Hyperspace handles data restoration automatically and transparently.

The following command creates a Collection.

hyperspace_client.commit(collection_name)
 hyperspaceClient.commit(collection_name);
await hyperspaceClient.commit(collection_name);

Where –

  • collection_name – Specifies the name of the Collection to be committed to the Hyperspace database.

Deleting a Collection

The following command describes how to delete a Collection.

hyperspace_client.delete_collection(collection_name)
await hyperspaceClient.deleteCollection(collection_name);
await hyperspaceClient.deleteCollection(collection_name);

Where –

  • collection_name – Specifies the name of the Collection to be deleted from the Hyperspace database.

You may want to do this in order to save storage space or clean up your space, but please note that this is an irreversible operation.

Clearing a Collection

The following describes how to clear a Collection, which erases all the data in the Collection.

hyperspace_client.clear_collection(collection_name)
hyperspaceClient.clearCollection(collection_name);
await hyperspaceClient.clearCollection(collection_name);

Getting a Collection Scheme

The following describes how to get a Collection's schema.

schema = hyperspace_client.get_schema(collection_name)
let schema = hyperspace_client.getSchema(collection_name);
const schema = hyperspace_client.getSchema(collection_name);

PreviousRetrieving ResultsNextUploading Data

Last updated 11 months ago