question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serializing as stream instead of string

See original GitHub issue

I’m trying to create an index over a large dataset and I want to separate the script that’s creating the index from the script that’s using the index. The index creation seems to work very well, but when I use index.export(), I’m getting a RangeError: Invalid string length error. Is there a way to export the index as a file without getting this error? A possible solution would be to allow exporting via a stream that could be written to a file directly.

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ts-thomascommented, Jun 28, 2021

Please change over to the version >= 0.7.x, thanks a lot.

1reaction
stefandesucommented, Mar 18, 2019

@ts-thomas Thanks for the quick reply! I’m currently using FlexSearch in Node.js. Glad to hear that native serialization capabilities will be supported soon. After posting the issue, I helped myself by adding an option to export the payload array instead of stringifying it, but a proper implementation would be better of course. The exported file is about 1.5 GB in size, currently I’m not even sure if our virtual machines can deal with that index in memory. 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I Serialize XML straight to a string instead of a Stream ...
Save this question. Show activity on this post. This example uses a StringWriter to hold the serialized data, then calling ToString() gives the...
Read more >
serialize and deserialize c# class into string - MSDN - Microsoft
when im serializing and deserializing the very same class from a file it works just fine. so it is possible for example to...
Read more >
ObjectOutputStream (Java Platform SE 7 ) - Oracle Help Center
To serialize an enum constant, ObjectOutputStream writes the string returned by the constant's name method. Like other serializable or externalizable objects, ...
Read more >
ObjectOutputStream in Java - write Object to File - DigitalOcean
The process of converting object to stream is called serialization in java. Once an object is converted to Output Stream, it can be...
Read more >
Different Serialization Approaches for Java - Baeldung
Serialization is the process of converting an object into a stream of bytes. That object can then be saved to a database or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found