transition |
---|
flip |
An introduction to the project structure.
import { Client } from "typesense"; | |
const typesense = new Client({ | |
nodes: [ | |
{ | |
host: "localhost", | |
port: 8108, | |
protocol: "http", | |
}, | |
], |
#!/bin/bash | |
TYPESENSE_HOST="${TYPESENSE_HOST:-http://localhost:8108}" | |
TYPESENSE_API_KEY="${TYPESENSE_API_KEY:-xyz}" | |
curl -X POST "$TYPESENSE_HOST/collections" \ | |
-H "Content-Type: application/json" \ | |
-H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" \ | |
-d '{ | |
"name": "products", |
bindl = , switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, preferred, auto, 1" | |
bindl = , switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable" |
Start Typesense instance
export TYPESENSE_API_KEY=xyz
mkdir $(pwd)/typesense-data
mkdir $(pwd)/analytics-data
docker run -p 8108:8108 -v$(pwd)/typesense-data:/data typesense/typesense:29.0.rc5 \
--data-dir /data --api-key=$TYPESENSE_API_KEY --enable-cors --enable-search-analytics=true \
--analytics-dir=analytics-data \
We'll create the collections in a specific order to handle references correctly:
curl -X POST 'http://localhost:8108/collections' \
-H 'X-TYPESENSE-API-KEY: YOUR_API_KEY' \