Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

sonic search backend client in python

License

NotificationsYou must be signed in to change notification settings

xmonader/python-sonic-client

Repository files navigation

Python client forsonic search backend.

Install

pip install sonic-client

Examples

Ingest

fromsonicimportIngestClientwithIngestClient("127.0.0.1",1491,"password")asingestcl:print(ingestcl.ping())print(ingestcl.protocol)print(ingestcl.bufsize)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

fromsonicimportSearchClientwithSearchClient("127.0.0.1",1491,"password")asquerycl:print(querycl.ping())print(querycl.query("wiki","articles","for"))print(querycl.query("wiki","articles","love"))print(querycl.suggest("wiki","articles","hell"))

Control

fromsonicimportControlClientwithControlClient("127.0.0.1",1491,"password")ascontrolcl:print(controlcl.ping())controlcl.trigger("consolidate")

API reference

API documentation can be found atdocs/api and alsoBrowsable

Difference from asonic

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

About

sonic search backend client in python

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp