Skip to main content

Python client for sonic search backend

Project description

Sonic Channel

Python client for sonic search backend.

We recommend you start with the documentation.

Installation

pip install pysonic-channel

Example usage

Search channel

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

from sonic import IngestChannel, SearchChannel, ControlChannel

querycl = SearchChannel("localhost:1491", "SecretPassword")
print(querycl.ping())
print(querycl.query("wiki", "articles", "for"))
print(querycl.query("wiki", "articles", "love"))
print(querycl.suggest("wiki", "articles", "hell"))

Ingest channel

Note: This example requires enabling the ingest feature.

from sonic import IngestChannel, SearchChannel, ControlChannel

ingestcl = IngestChannel("localhost:1491", "SecretPassword")
print(ingestcl.ping())
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")

Control channel

Note: This example requires enabling the control feature.

from sonic import IngestChannel, SearchChannel, ControlChannel

controlcl = ControlChannel("localhost:1491", "SecretPassword")
print(controlcl.ping())
print(controlcl.consolidate())

Available features

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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pysonic_channel-0.1.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

pysonic_channel-0.1.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

pysonic_channel-0.1.1-cp310-none-win_amd64.whl (501.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pysonic_channel-0.1.1-cp310-none-win32.whl (445.7 kB view hashes)

Uploaded CPython 3.10 Windows x86

pysonic_channel-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

pysonic_channel-0.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

pysonic_channel-0.1.1-cp39-none-win_amd64.whl (500.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pysonic_channel-0.1.1-cp39-none-win32.whl (445.7 kB view hashes)

Uploaded CPython 3.9 Windows x86

pysonic_channel-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pysonic_channel-0.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

pysonic_channel-0.1.1-cp39-cp39-macosx_10_7_x86_64.whl (637.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

pysonic_channel-0.1.1-cp38-none-win_amd64.whl (501.3 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pysonic_channel-0.1.1-cp38-none-win32.whl (446.0 kB view hashes)

Uploaded CPython 3.8 Windows x86

pysonic_channel-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pysonic_channel-0.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

pysonic_channel-0.1.1-cp37-none-win_amd64.whl (501.6 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

pysonic_channel-0.1.1-cp37-none-win32.whl (445.9 kB view hashes)

Uploaded CPython 3.7 Windows x86

pysonic_channel-0.1.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

pysonic_channel-0.1.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ i686

pysonic_channel-0.1.1-cp36-none-win_amd64.whl (501.2 kB view hashes)

Uploaded CPython 3.6 Windows x86-64

pysonic_channel-0.1.1-cp36-none-win32.whl (445.6 kB view hashes)

Uploaded CPython 3.6 Windows x86

pysonic_channel-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

pysonic_channel-0.1.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.5+ i686

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page