Anh-Jo
05/15/2023, 3:54 PMexport TYPESENSE_API_KEY=xyz
curl "<http://localhost:8108/collections>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"name": "user",
"fields": [
{"name": "username", "type": "string" },
{"name": "db_id", "type": "string" },
],
"default_sorting_field": ""
}'
curl "<http://localhost:8108/collections/user/documents/import?action=create>" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-H "Content-Type: text/plain" \
-X POST \
-d '{"id": "1","username": "UserTest","db_id": "1"}
{"id": "2","username": "UserTest1","db_id": "2"}'
curl "<http://localhost:8108/multi_search>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"searches": [
{
"collection": "user",
"q": "UserTest",
"query_by": "username,db_id"
}
]
}'
but with around 490k users with around 121 name near my expeceted result