Getting Started

Install Torque, start the server, and run your first search query in under five minutes.

Install

Download the latest release from the Torque product page or follow the instructions for your platform:

Latest version: 0.5.0

Download torque-0.5.0-x86_64-linux.tar.gz

# Download and extract
curl -LO /releases/torque/latest/torque-0.5.0-x86_64-linux.tar.gz
tar xzf torque-0.5.0-x86_64-linux.tar.gz

# Move to PATH (optional)
sudo mv torque-server /usr/local/bin/
sudo mv torque-admin /usr/local/bin/

# Start the server
torque-server --api-key YOUR_API_KEY

Download torque-0.5.0-x86_64-windows.zip

# Download and extract
Invoke-WebRequest -Uri /releases/torque/latest/torque-0.5.0-x86_64-windows.zip -OutFile torque.zip
Expand-Archive torque.zip -DestinationPath torque

# Start the server
.\torque\torque-server.exe --api-key YOUR_API_KEY

To run as a Windows service, see Server Configuration.

macOS release not currently available. Check back soon.

# Pull the image
docker pull truespar/torque

# Run the server
docker run -p 8108:8108 -p 8109:8109 truespar/torque

# With persistent storage and an explicit API key
docker run -d --name torque \
  -p 8108:8108 -p 8109:8109 \
  -v torque-data:/data \
  -e TORQUE_API_KEY=YOUR_API_KEY \
  truespar/torque

The container exposes port 8108 (HTTP API and Studio) and port 8109 (TCP binary ingest). The /data volume persists indexes, schemas, keys, and overlay state across restarts. Omit TORQUE_API_KEY to let the server auto-generate a bootstrap key on first boot — it will be printed in the startup banner.

Requirements

  • Operating system: Windows, Linux, or macOS
  • RAM: 512 MB minimum (more for larger datasets — all data lives in memory)
  • GPU (optional): Any CUDA-capable NVIDIA GPU for accelerated search — shipped as a separate build artifact

Start the Server

The server starts two listeners:

  • HTTP API on port 8108 — for search, CRUD, and Studio
  • TCP ingest on port 8109 — for high-speed binary document streaming

On startup, Torque prints the API key and port information. You will need the API key to access Studio and the HTTP API.

Tip: Set TORQUE_LICENSE_KEY to activate your license and remove trial restrictions. See Server Configuration for all options.

Configuration File

Place a torque.toml file in the working directory and Torque will load it automatically:

api_key = "YOUR_API_KEY"
data_dir = "./data"
log_level = "info"

See Server Configuration for all available settings.

Open Studio

Open http://localhost:8108 in your browser. Enter your API key to log in. Studio provides a search query editor, schema browser, API key management, and data import tools.

Create a Collection

A collection holds documents with a defined schema. Create one via the HTTP API:

curl -X POST http://localhost:8108/collections \
  -H "X-TYPESENSE-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "products",
    "fields": [
      {"name": "title", "type": "string"},
      {"name": "description", "type": "string"},
      {"name": "price", "type": "float"},
      {"name": "category", "type": "string", "facet": true},
      {"name": "in_stock", "type": "bool"}
    ],
    "default_sorting_field": "price"
  }'

See Collections for all field types and options.

Add Documents

Import documents using the JSONL import endpoint:

curl -X POST "http://localhost:8108/collections/products/documents/import" \
  -H "X-TYPESENSE-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: text/plain" \
  -d '{"id": "1", "title": "Running Shoes", "description": "Lightweight running shoes", "price": 89.99, "category": "Footwear", "in_stock": true}
{"id": "2", "title": "Hiking Boots", "description": "Waterproof hiking boots", "price": 149.99, "category": "Footwear", "in_stock": true}
{"id": "3", "title": "Laptop Stand", "description": "Adjustable aluminum laptop stand", "price": 49.99, "category": "Electronics", "in_stock": false}'

For large datasets, use the TCP binary protocol or TQBF binary file upload for significantly faster ingestion.

Search

Run a search query:

curl "http://localhost:8108/collections/products/documents/search?\
q=shoes&query_by=title,description&filter_by=in_stock:true&sort_by=price:asc" \
  -H "X-TYPESENSE-API-KEY: YOUR_API_KEY"

The response includes matching documents with highlights, facet counts, and timing information.

Typesense Compatibility

Torque implements the Typesense v30.1 REST API. Existing Typesense client libraries work without code changes — point them at your Torque server instead:

import typesense

client = typesense.Client({
    'nodes': [{'host': 'localhost', 'port': '8108', 'protocol': 'http'}],
    'api_key': 'YOUR_API_KEY',
    'connection_timeout_seconds': 2
})

results = client.collections['products'].documents.search({
    'q': 'shoes',
    'query_by': 'title,description'
})

Next Steps

  • Server Configuration — CLI arguments, environment variables, memory limits
  • Collections — schemas, field types, nested fields, aliases
  • Search — query parameters, text search, prefix, typo tolerance
  • Filtering — filter syntax and operators
  • TCP Protocol — high-speed binary ingestion
  • .NET SDK — official client library for .NET applications
  • Python SDK — HTTP client and TCP ingest for Python 3.10+
  • Go SDK — HTTP client and TCP ingest for Go 1.23+
  • Java SDK — HTTP client and TCP ingest for Java 21+
  • Node.js SDK — HTTP client and TCP ingest for Node.js 20+