# Quickstart
URL: /docs/quickstart

Create a collection, index documents, and search — end to end.



## 1. Run Tachyon [#1-run-tachyon]

```bash
docker run -p 8108:8108 adikeshri/tachyon
```

Reaching for a typed client instead of raw HTTP? Every code tab below also
has a TypeScript, Python, and C# option — see [SDKs](/docs/sdks) for the full
reference.

## 2. Create a collection [#2-create-a-collection]

Declare the fields you want to index. Only fields marked `filter`, `sort`, or
`facet` can be used that way in a search — see [Collections](/docs/collections)
for the full field schema.

<Tabs items="['cURL', 'TypeScript', 'Python', 'C#']">
  <Tab value="cURL">
    ```bash
    curl -X POST localhost:8108/collections \
      -H 'Content-Type: application/json' \
      -d '{
        "name": "products",
        "fields": [
          {"name": "title",       "type": "text"},
          {"name": "description", "type": "text"},
          {"name": "brand",       "type": "keyword", "facet": true},
          {"name": "price",       "type": "int",     "filter": true, "sort": true}
        ]
      }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    import { Tachyon } from 'tachyon-sdk';

    const client = new Tachyon({ url: 'http://localhost:8108' });

    await client.collections.create({
      name: 'products',
      fields: [
        { name: 'title', type: 'text' },
        { name: 'description', type: 'text' },
        { name: 'brand', type: 'keyword', facet: true },
        { name: 'price', type: 'int', filter: true, sort: true },
      ],
    });
    ```
  </Tab>

  <Tab value="Python">
    ```python
    from tachyon_sdk import Tachyon

    client = Tachyon(url="http://localhost:8108")

    client.collections.create({
        "name": "products",
        "fields": [
            {"name": "title", "type": "text"},
            {"name": "description", "type": "text"},
            {"name": "brand", "type": "keyword", "facet": True},
            {"name": "price", "type": "int", "filter": True, "sort": True},
        ],
    })
    ```
  </Tab>

  <Tab value="C#">
    ```csharp
    using Tachyon.Sdk;

    var client = new TachyonClient(new TachyonClientOptions { Url = "http://localhost:8108" });

    await client.Collections.CreateAsync(new CollectionSchema
    {
        Name = "products",
        Fields =
        [
            new FieldSchema { Name = "title", Type = FieldType.Text },
            new FieldSchema { Name = "description", Type = FieldType.Text },
            new FieldSchema { Name = "brand", Type = FieldType.Keyword, Facet = true },
            new FieldSchema { Name = "price", Type = FieldType.Int, Filter = true, Sort = true },
        ],
    });
    ```
  </Tab>
</Tabs>

## 3. Index documents [#3-index-documents]

Documents are flat JSON objects — send a single object or an array. `id` is
implicit; you don't declare it as a field.

<Tabs items="['cURL', 'TypeScript', 'Python', 'C#']">
  <Tab value="cURL">
    ```bash
    curl -X POST localhost:8108/collections/products/documents \
      -H 'Content-Type: application/json' \
      -d '[
        {"id": "1", "title": "Wireless Mouse", "brand": "Logitech", "price": 2999},
        {"id": "2", "title": "Mechanical Keyboard", "brand": "Razer", "price": 8999}
      ]'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    import { Tachyon } from 'tachyon-sdk';

    const client = new Tachyon({ url: 'http://localhost:8108' });

    await client.collection('products').documents.index([
      { id: '1', title: 'Wireless Mouse', brand: 'Logitech', price: 2999 },
      { id: '2', title: 'Mechanical Keyboard', brand: 'Razer', price: 8999 },
    ]);
    ```
  </Tab>

  <Tab value="Python">
    ```python
    from tachyon_sdk import Tachyon

    client = Tachyon(url="http://localhost:8108")

    client.collection("products").documents.index([
        {"id": "1", "title": "Wireless Mouse", "brand": "Logitech", "price": 2999},
        {"id": "2", "title": "Mechanical Keyboard", "brand": "Razer", "price": 8999},
    ])
    ```
  </Tab>

  <Tab value="C#">
    ```csharp
    using Tachyon.Sdk;

    var client = new TachyonClient(new TachyonClientOptions { Url = "http://localhost:8108" });

    var collection = client.Collection("products");
    await collection.Documents.IndexAsync(
        new Document { ["id"] = "1", ["title"] = "Wireless Mouse", ["brand"] = "Logitech", ["price"] = 2999 },
        new Document { ["id"] = "2", ["title"] = "Mechanical Keyboard", ["brand"] = "Razer", ["price"] = 8999 });
    ```
  </Tab>
</Tabs>

## 4. Search [#4-search]

<Tabs items="['cURL', 'TypeScript', 'Python', 'C#']">
  <Tab value="cURL">
    ```bash
    curl 'localhost:8108/collections/products/search?q=wireless+mouse'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    import { Tachyon } from 'tachyon-sdk';

    const client = new Tachyon({ url: 'http://localhost:8108' });

    const results = await client.collection('products').search({ q: 'wireless mouse' });
    for (const hit of results.hits) {
      console.log(hit.document.title, hit.text_match);
    }
    ```
  </Tab>

  <Tab value="Python">
    ```python
    from tachyon_sdk import Tachyon

    client = Tachyon(url="http://localhost:8108")

    results = client.collection("products").search(q="wireless mouse")
    for hit in results["hits"]:
        print(hit["document"]["title"], hit["text_match"])
    ```
  </Tab>

  <Tab value="C#">
    ```csharp
    using Tachyon.Sdk;

    var client = new TachyonClient(new TachyonClientOptions { Url = "http://localhost:8108" });

    var results = await client.Collection("products").SearchAsync(new SearchParams { Q = "wireless mouse" });
    foreach (var hit in results.Hits)
    {
        Console.WriteLine($"{hit.Document["title"]} {hit.TextMatch}");
    }
    ```
  </Tab>
</Tabs>

```json
{
  "found": 1,
  "found_is_exact": true,
  "search_time_ms": 0,
  "hits": [
    {
      "document": { "id": "1", "title": "Wireless Mouse", "brand": "Logitech", "price": 2999 },
      "text_match": 554.788
    }
  ]
}
```

This is the response body over HTTP — each SDK returns the equivalent parsed
object instead of raw JSON.

Typo tolerance is on by default — the same query, misspelled, still finds it:

```bash
curl 'localhost:8108/collections/products/search?q=wirelss+mouse'
```

## Next steps [#next-steps]

* [Filtering](/docs/filtering), [sorting](/docs/sorting), and
  [faceting](/docs/faceting) on the fields you declared
* [Configuration](/docs/configuration) — set an API key before this leaves
  your laptop
* [SDKs](/docs/sdks) — skip the raw HTTP calls with a typed client for
  TypeScript, Python, or C#
* Full [API Reference](/api) for every parameter and response field
