ppshobi / psonic

Sonic is a super fast auto suggestion engine built by the team at crisp.chat, a customer engagement platform. its built in Rust and they officially support a javascript client, but if you want to use sonic via php, this is the library that you can look for. Completely unit tested, and adheres to modern coding standards, and offers a clean api to interact with sonic.
MIT License
130 stars 9 forks source link

PHP Fatal error: Uncaught ValueError: str_split(): Argument #2 ($length) must be greater than 0 #37

Closed bluusun closed 1 year ago

bluusun commented 1 year ago

Brew package installation.

Sample code as per instructions.

Stack trace:

0 /Users/...: str_split('hi Shobi how ar...', -55)

1 /Users/..../src/Ingest.php(55): Psonic\Ingest->splitString('messagesCollect...', 'defaultBucket', '1234', 'hi Shobi how ar...')

2 /Users/.../test.php(10): Psonic\Ingest->push('messagesCollect...', 'defaultBucket', '1234', 'hi Shobi how ar...')

3 {main}

thrown in /..../psonic/src/Ingest.php on line 146

bluusun commented 1 year ago

Seems like password was incorrect. A nicer error message would be appreciated :)

ppshobi commented 1 year ago

hmm. not sure how the -55 ended up there. do you have a way to reproduce this?