sonic
client for sonic search backend
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Passing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install sonic
choosenim install sonic
git clone https://github.com/xmonader/nim-sonic-client
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| sonic | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/xmonader/nim-sonic-client |
|---|---|
| Homepage | https://github.com/xmonader/nim-sonic-client |
| Documentation | View Documentation |
| Registry Source | nimble_official |
README
nim-sonic-client
nim client for sonic search backend.
Install
nimble install sonic
Examples
Ingest
var cl = open("127.0.0.1", 1491, "dmdm", SonicChannel.Ingest)
echo $cl.execCommand("PING")
echo cl.ping()
echo cl.protocol
echo cl.bufsize
echo cl.push("wiki", "articles", "article-1",
"for the love of god hell")
echo cl.push("wiki", "articles", "article-2",
"for the love of satan heaven")
echo cl.push("wiki", "articles", "article-3",
"for the love of lorde hello")
echo cl.push("wiki", "articles", "article-4",
"for the god of loaf helmet")
PONG
true
0
0
true
2
0
true
true
true
Search
var cl = open("127.0.0.1", 1491, "dmdm", SonicChannel.Search)
echo $cl.execCommand("PING")
echo cl.ping()
echo cl.query("wiki", "articles", "for")
echo cl.query("wiki", "articles", "love")
echo cl.suggest("wiki", "articles", "hell")
echo cl.suggest("wiki", "articles", "lo")
PONG
true
@[]
@["article-3", "article-2"]
@[]
@["loaf", "lorde", "love"]
Control
var cl = open("127.0.0.1", 1491, "dmdm", SonicChannel.Control)
echo $cl.execCommand("PING")
echo cl.ping()
echo cl.trigger("consolidate")
PONG
true
OK
API reference
API documentation can be found at docs/api and also Browsable
Generating docs
use nimble genDocs