#community-help

Error Building Search App - Timeout Issue with Data Import

TLDR Zaiste faced an error while following a search app building tutorial due to data set size. He suggested a batch import method and sent a PR to the document. Jason acknowledged the issue and thanked Zaiste for the PR.

Powered by Struct AI

1

4
26mo
Solved
Join the chat
Nov 15, 2021 (26 months ago)
Zaiste
Photo of md5-b12c0749a9dbaefc03cb5817250a595d
Zaiste
09:06 PM
I’m going through your Build A Search Application tutorial. When I try to add books data to the collection from the provided sample using the stream snippet, I’m getting: Request #1637009712744: Request to Node 0 failed due to "ECONNABORTED timeout of 2000ms exceeded" and the populate script freezes while some data is added. The books data set has 9979 items; when I try with a smaller set of just few books it works without problem. How should I initialise the client to avoid this error?
09:24
Zaiste
09:24 PM
It seems we can use the .import() method along with the batch option. I made a suggestion to the docs: https://github.com/typesense/typesense-website/pull/108/files
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:36 PM
Zaiste I'm surprised that it's throwing that error even with single document inserts. I tried it a few weeks ago and it seemed to work fine... May I know which Typesense version you're using?

In any case, that example that reads 1 line at a time and imports it into Typesense one by one was written before we added the bulk import feature. I've been meaning to update that example with the import method, so thank you for the PR!

1

Nov 16, 2021 (26 months ago)
Zaiste
Photo of md5-b12c0749a9dbaefc03cb5817250a595d
Zaiste
08:21 PM
Jason I’m using 0.21.0 I believe it just overflows the Typesense with these singular inserts