-
-
Save kishorenc/fe9fd5587f5e8e758da8b3d81091f447 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -k "http://localhost:8108/collections" -X POST -H "Content-Type: application/json" \ | |
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{ | |
"name": "titles", "num_memory_shards": 4, | |
"fields": [ | |
{"name": "title", "type": "string", "locale": "th" }, | |
{"name": "points", "type": "int32" } | |
], | |
"default_sorting_field": "points" | |
}' | |
curl 'http://localhost:8108/collections/titles/documents?dirty_values=coerce_or_reject&action=upsert' -X POST \ | |
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{"points":100,"title":"ติดกับดักรายได้ปานกลาง", "id": "0"}' | |
curl 'http://localhost:8108/collections/titles/documents?dirty_values=coerce_or_reject&action=upsert' -X POST \ | |
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{"points":100,"title":"ข้อมูลรายคนหรือรายบริษัทในการเชื่อมโยงส่วนได้ส่วนเสีย", "id": "1"}' | |
# Search | |
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" http://localhost:8108/collections/titles/documents/search/\?q\=%E0%B8%A3%E0%B8%B2%E0%B8%A2%E0%B9%84%E0%B8%94%E0%B9%89\&query_by\=title\&num_typos\=0\&sort_by\=_text_match:desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment