tinysearch: Error: NotEnoughSpace
Error
./tinysearch public/index.json
Error: NotEnoughSpace
Index file
ls -lha public/index.json
-rw-r--r-- 1 q q 6,7M Jun 11 22:46 public/index.json
strace results
strace ./tinysearch public/index.json -p /tmp/
...
getrandom("", 0, GRND_NONBLOCK) = 0
getrandom("\x1d\xee\x9e\xa5\x0c\x2d\xf4\x99\x9c\x9a\xe5\xb8\xc4\x52\x05\xb7\x4c\x3c\x2a\x79\xe4\xee\x5f\x24\xaf\x1e\xcf\x62\xb8\x49\x35\x97", 32, GRND_NONBLOCK) = 32
write(2, "Error: ", 7Error: ) = 7
write(2, "NotEnoughSpace", 14NotEnoughSpace) = 14
write(2, "\n", 1
) = 1
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
munmap(0x7f7fffdd5000, 12288) = 0
exit_group(1) = ?
+++ exited with 1 +++
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 45 (26 by maintainers)
Commits related to this issue
- Increase padding to address NotEnoughSpace error (see #111) — committed to tinysearch/tinysearch by mre 4 years ago
- Increase padding to address NotEnoughSpace error (see #111) (#121) — committed to tinysearch/tinysearch by mre 4 years ago
This bug should now be fixed in
master. I ported tinysearch over to Xor filters.TINY_MAGIC. The Xor filter doesn’t run into this problem.Along the way I cleand up the custom serialization code, removed the forked dependencies, which were no longer needed and updated the docs. Oh and I replaced
lazy_static!withonce_cell!andinclude_bytes!with the newinclude_str. All around good update. 😄If anyone wants to give it a shot. I’ll close this to clean up the issue tracker, but feel free to play with the
masterbranch and report back here.Thanks for the great work @fluential
Was able to build a search index using magic number 64, end result is
This is including all the content, could cut it down if I used the title only.
Probably good enough for me as I’m building media heavy website.
@quangloc1993 Better create a new issue regarding that
This project is mostly about generating the search database using rust/wasm, there’s only a very basic example of usage.
If you need supporting older browsers, you may need to investigate it yourself…
But let’s start with making new issue 👍
Actually, I think we can use #15 for that.
Sure! Will create a new issue for that.
Going from 26 to 64 the produced files go from 780KB to 868KB.
Hm… 🤔 So these files were generated:
But not a demo.html so that i could access http://0.0.0.0:8000/demo.html as explained in the README:
Edit: But when I copy that file manually from https://raw.githubusercontent.com/mre/tinysearch/master/bin/assets/demo.html, searches seem to work 💯
I wonder if it’s a good idea to make that value configurable still. Apparently there’s a trade-off for high values, so maybe only people with large indices running into errors should be paying that, while you have a low default that caters to most use cases.
@mre Actually I’ve checked and for nginx to serve gzipped wasm requires extra config for mime types
echo 'application/wasm wasm;' >> /etc/nginx/mime.typesand adding togzip_typesvia https://rustwasm.github.io/book/reference/deploying-to-production.html
Thanks for hint!