Hello. Is there any command line tool to import do...
# community-help
y
Hello. Is there any command line tool to import docs, like
solr post
, if I import a very large file 400MB+ with Millions of lines, it will be very hard to import the data by using CURL/HTTP requests.
a
Hey! You can use the batch import feature to load the entire file in one go. If the import feels slow, you can parallelize it using GNU
parallel
like this:
Copy code
parallel --block -5 -a documents.jsonl --tmpdir /tmp --pipepart --cat \
  'curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -X POST -T {} \
  <http://localhost:8108/collections/><collection>/documents/import?action=create'
This splits the input file into 5MB chunks and streams them concurrently to the import endpoint. More on the available import options here: https://typesense.org/docs/28.0/api/documents.html#import-a-jsonl-file