最後活躍 1728772630

Typesense-readme-3.py 原始檔案
1import typesense
2
3client = typesense.Client({
4 'api_key': 'Hu52dwsas2AdxdE',
5 'nodes': [{
6 'host': 'localhost',
7 'port': '8108',
8 'protocol': 'http'
9 }],
10 'connection_timeout_seconds': 2
11})
12
13create_response = client.collections.create({
14 "name": "companies",
15 "fields": [
16 {"name": "company_name", "type": "string" },
17 {"name": "num_employees", "type": "int32" },
18 {"name": "country", "type": "string", "facet": True }
19 ],
20 "default_sorting_field": "num_employees"
21})