pleshevskiy/sonic-channel

Sonic-channel is a rust client for the sonic search backend

Quick and easy way to get started with search in rust

Sonic Channel

Rust client for sonic search backend.

We recommend you start with the documentation.

Installation

Add sonic-channel = { version = "0.4" } as a dependency in Cargo.toml.

Cargo.toml example:

[package]
name = "my-crate"
version = "0.1.0"
authors = ["Me <[email protected]>"]

[dependencies]
sonic-channel = { version = "0.4" }

Example usage

Search channel

Note: This example requires enabling the search feature, enabled by default.

use sonic_channel::*;

fn main() -> result::Result<()> {
    let channel = SearchChannel::start("localhost:1491", "SecretPassword")?;
    let objects = channel.query("collection", "bucket", "recipe")?;
    dbg!(objects);

    Ok(())
}

Ingest channel

Note: This example requires enabling the ingest feature.

use sonic_channel::*;

fn main() -> result::Result<()> {
    let channel = IngestChannel::start("localhost:1491", "SecretPassword")?;
    let pushed = channel.push("collection", "bucket", "object:1", "my best recipe")?;
    // or
    // let pushed = channel.push_with_locale("collection", "bucket", "object:1", "Мой лучший рецепт", "rus")?;
    dbg!(pushed);

    Ok(())
}

Control channel

Note: This example requires enabling the control feature.

use sonic_channel::*;

fn main() -> result::Result<()> {
    let channel = ControlChannel::start("localhost:1491", "SecretPassword")?;
    let result = channel.consolidate()?;
    assert_eq!(result, true);

    Ok(())
}

Available features

  • default - ["search"]
  • search - Add sonic search mode with methods
  • ignite - Add sonic ignite mode with methods
  • control - Add sonic control mode with methods
Issues

Collection of the latest Issues

tvolk131

tvolk131

enhancement
Comment Icon3

I'd love to see non-blocking I/O that works with Tokio! I don't know exactly how this would work under the hood, but I'm happy to look into it if you're interested.

Versions

Find the latest versions by id

v0.6.0 - Mar 23, 2022

Changelog

  • feat: auto detect missed lang attribute for query command (@lonexw)
  • feat: auto detect lang attribute for push command if not specified

v0.5.0 - Dec 22, 2021

  • BREAKING: rename ErrorKind variants (#11)
  • handle sonic server-side errors for each commands (#11)

v0.4.2 - Dec 21, 2021

Changelog

  • Convert multi-line input to single-line for push command

v0.4.1 - Jul 12, 2021

  • Removed dbg statements (by @vishalsodani)
  • Fix new clippy warnings

v0.4.0 - Nov 25, 2020

Changelogs

refac!: separate structs for each channel (#3)

BREAKING CHANGES: SonicChannel struct was separated to 3 new struct: SearchChannel, IngestChannel and ControlChannel.

v0.3.2 - Oct 16, 2020

Changelogs:

  • Deny and fix all clippy lints
  • Cosmetic changes

v0.3.1 - Aug 07, 2020

Changelogs:

  • feat: add mode condition for channel commands
  • doc: add commands to channel mode enum
  • chore: remove dead code

v0.3.0 - Aug 07, 2020

Changelog:

  • feat(ingest): implement count command
  • feat(control): implement trigger command
  • refac: add wrong sonic response error for not supported response
  • doc: fix variable name for search channel commands

v0.2.2 - Aug 01, 2020

Changelogs:

  • feat: add pop method for ingest mode
  • fix: remove optional mark for regex crate
  • doc: add examples for all methods of sonic ingest mode
  • doc: add notes about required features to methods and examples (#1)

v0.2.1 - Jul 26, 2020

First public release

Information - Updated Jun 03, 2022

Stars: 24
Forks: 5
Issues: 1

A Full-Text Search Engine in Rust

Toshi will always target stable Rust and will try our best to never make any use of unsafe Rust

A Full-Text Search Engine in Rust

txtai: AI-powered search engine for Rust

Overview of the functionality provided by txtai

txtai: AI-powered search engine for Rust

Roogle is a Rust API search engine, which allows you to search functions by names...

Roogle is a Rust API search engine, which allows you to search functions by names and type signatures

Roogle is a Rust API search engine, which allows you to search functions by names...

Non-official rust library to search Nyaa

si does not provide any APIs so I thought it would be cool to have a way to do so in Rust and that's why...

Non-official rust library to search Nyaa

Roogle is a Rust API search engine, which allows you to search functions by names...

Roogle is a Rust API search engine, which allows you to search functions by names and type signatures

Roogle is a Rust API search engine, which allows you to search functions by names...

SerpApi Search in Rust

This Rust package enables to scrape and parse search results from Google, Bing, Baidu, Yandex, Yahoo, Ebay, Apple, Youtube, Naver, Home depot and more

SerpApi Search in Rust

Elerons - ELectRONics Search with Rust

Elerons is a command line tool for electronic component selection and design optimization facilitated by engineering know-how infused into the software itself

Elerons - ELectRONics Search with Rust

Catalog searcher

A demo product catalog searcher written in Rust

Catalog searcher

A Tiny, Static, Full-text Search with Rust

Add the -r argument to traverse hierarchy recursively

A Tiny, Static, Full-text Search with Rust

A Tiny, Static, Full-text Search with Rust

Add the -r argument to traverse hierarchy recursively

A Tiny, Static, Full-text Search with Rust
Facebook Instagram Twitter GitHub Dribbble
Privacy