Md Shah Ali
05/22/2025, 11:11 AM### Run Typesense via Docker ########################################
export TYPESENSE_API_KEY=xyz
mkdir "$(pwd)"/typesense-data
docker run -p 8108:8108 \
-v"$(pwd)"/typesense-data:/data typesense/typesense:28.0 \
--data-dir /data \
--api-key=$TYPESENSE_API_KEY \
--enable-cors
### Reproduction Steps ###############################################
export TYPESENSE_API_KEY=xyz
curl "<http://localhost:8108/debug>" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"
curl "<http://localhost:8108/collections>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"name": "companies",
"fields": [
{"name": "name", "type": "string","index": true },
{"name": "id", "type": "string" }
],
"default_sorting_field": ""
}'
curl "<http://localhost:8108/collections/companies/documents/import?action=create>" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-H "Content-Type: text/plain" \
-X POST \
-d ' {"id": "3","name": "QUEEN REMI BLUE 12\"#TUR"}
{"id": "4","name": "QUEEN REMI BLUE 12\"#613"}
{"id": "1","name": "QUEEN REMI BLUE OW 12\"#P430"}
{"id": "2","name": "QUEEN REMI BLUE OW 12\"#613"}'
curl "<http://localhost:8108/multi_search>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"searches": [
{
"collection": "companies",
"q": "QUEEN REMI BLUE 12",
"query_by": "name"
}
]
}'