Skip to main content

python client for sonic search backend

Project description

# python-sonic-client

Python client for [sonic]( search backend.

## Install

pip install sonic-client

## Examples

### Ingest

from sonic import IngestClient

with IngestClient("", 1491, "password") as ingestcl:
ingestcl.push("wiki", "articles", "article-1", "for the love of god hell")
ingestcl.push("wiki", "articles", "article-2", "for the love of satan heaven")
ingestcl.push("wiki", "articles", "article-3", "for the love of lorde hello")
ingestcl.push("wiki", "articles", "article-4", "for the god of loaf helmet")

### Search

from sonic import SearchClient

with SearchClient("", 1491, "password") as querycl:
print(querycl.query("wiki", "articles", "for"))
print(querycl.query("wiki", "articles", "love"))
print(querycl.suggest("wiki", "articles", "hell"))

### Control

from sonic import ControlClient

with ControlClient("", 1491, "password") as controlcl:

## Difference from asonic

asonic uses asyncio and this client doesn't. It grew out of needing to use sonic within gevent context

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
sonic-client-0.0.3.tar.gz (5.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page