No description
Find a file
xmonader 452920ba19
Merge pull request #2 from hqm42/master
actually use channel type in asyncSonic
2019-06-05 11:43:19 +02:00
docs/api update docs 2019-05-31 16:40:51 +02:00
src actually use channel type in asyncSonic 2019-06-05 10:07:51 +02:00
README.md Fix API docs broken link 2019-04-19 18:48:52 +02:00
sonic.nimble docs improvements 2019-04-11 20:01:21 +02:00

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

    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