Skip to content

Commit 2bb016c

Browse files
committed
add info for typesense usage for testing
1 parent 753b64c commit 2bb016c

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
typesense
2+
~~~~~~~~~
3+
4+
requirements: to pretty print json, install jq on your system;
5+
6+
7+
in terminal export the API key
8+
9+
.. code-block::
10+
11+
export TYPESENSE_API_KEY='xyz'
12+
export TYPESENSE_HOST='http://localhost:8108'
13+
14+
list all collections (indexes):
15+
16+
.. code-block::
17+
18+
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
19+
"http://localhost:8108/collections" | jq
20+
21+
22+
retrieve collection details of the products collection (index):
23+
24+
.. code-block::
25+
26+
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
27+
-X GET "http://localhost:8108/collections/products" | jq
28+
29+
30+
list aliases:
31+
32+
.. code-block::
33+
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
34+
"http://localhost:8108/aliases" | jq
35+
36+
37+
38+
get alias info:
39+
40+
.. code-block::
41+
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
42+
"http://localhost:8108/aliases/products" | jq
43+
44+
45+
46+
47+
search for all products:
48+
49+
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
50+
"http://localhost:8108/collections/products/documents/search?q=*" | jq

0 commit comments

Comments
 (0)