#random

Importing a Collection to Typesense Server with curl

TLDR Kevin inquired about importing a collection directly to a Typesense server using curl. Jason confirmed this was possible, but the schema must be created first.

Powered by Struct AI
4
3mo
Solved
Join the chat
Aug 14, 2023 (3 months ago)
Kevin
Photo of md5-914a8b39b82fd99b8ecd985427660deb
Kevin
02:35 PM
Hi! Would it be possible to simply import a collection to a Typesense server with curl, in the same way that it is possible to export one with curl? It seems as though it would be necessary to create a collection first but if anyone knows a shortcut that would be great.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:59 PM
Yup, you can bulk import JSONL using this endpoint: https://typesense.org/docs/0.24.1/api/documents.html#index-multiple-documents
Aug 15, 2023 (3 months ago)
Kevin
Photo of md5-914a8b39b82fd99b8ecd985427660deb
Kevin
07:08 AM
Hi thanks for the info. I tried the bulk import but it only worked when I specified an existing collection. Even then there were a number of eror messages. There is no way to import an entire collect 'from scratch'? Thanks!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:54 PM
No, you would have to create the schema using the POST /collections endpoint and then import the documents