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
  2. Setting Up

Connecting to the Hyperspace Server

The following describes how to create a local instance of the Hyperspace client, which will enable you to connect to the database through the Hyperspace API. Hyperspace provides you with a username, password and the address of the cloud machine to which you will connect using the Hyperspace API.

To create a local instance of the Hyperspace client –

Copy the following code snippet to enable a connection to the database through the Hyperspace API.

hyperspace_client = hyperspace.HyperspaceClientApi(host=host_address,
                                                   username=username,
                                                   password=password)
import io.hyperspace.client.HyperspaceClient;
HyperspaceClient hyperspaceClient = new HyperspaceClient(host, username, password);
const hs = require('hyperspace-js')
const hyperspaceClient = new hs.HyperspaceClient(host_address, username, password); 
  • Replace host_address with the address of the Hyperspace cloud machine that you will access. This will be provided to you by Hyperspace.

  • Replace username and password with the user name and password provided to you by Hyperspace.

To check that the client is live, run the following command -

print(hyperspace_client.collections_info())
Object info = hyperspaceClient.collectionsInfo(); 
System.out.println(new Gson().toJson(info));
const { data } = await hyperspaceClient.info();
console.log(data);

A status message similar to the following should appear –

[{'Collections size': {'GeneratedData': 0, 'Number of total vectors': 98792}, {'Number of data nodes': 1}]

If no status message appears, contact support for assistance.

PreviousInstalling the Hyperspace API ClientNextCreating a Database Schema Configuration File

Last updated 10 months ago