valeriansaliou / sonic

🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.
https://crates.io/crates/sonic-server
Mozilla Public License 2.0
20.11k stars 578 forks source link

What's the max length for an obj? #318

Closed bendangelo closed 11 months ago

bendangelo commented 11 months ago

This isn't documented anywhere. I think it's around 100 characters? Is it possible to also return an err with a message saying it's too long or a code?

valeriansaliou commented 11 months ago

See https://github.com/valeriansaliou/sonic/blob/master/config.cfg#L38

It is configurable.

bendangelo commented 11 months ago

I think you misunderstood the question. When doing a PUSH and I push an obj with a length of over 200 or so, the server will throw an error. An example would be: PUSH all tags Really_long_obj_name_123434545754674567234523452435523452345234523452342345234234523452345234523452345324324523455 "value"

valeriansaliou commented 11 months ago

Ah, got it. There is a buffer max length that’s announced while connecting to the channel. You need to perform a word split to stay under this buffer max size and split your push into 2 sub requests. If we’re speaking about the object name then you need to make them much shorter, eg hash it before pushing since it’s non splittable.

bendangelo commented 11 months ago

Ok got it thanks.