algoliasearch client python
4.9.2
ドキュメント•Django•コミュニティフォーラム•スタックオーバーフロー•バグを報告•FAQ•サポート
3.8からPythonをサポートしますまず、PIPパッケージマネージャーを介してAlgolia Python APIクライアントをインストールします。
pip install --upgrade ' algoliasearch>=4.0,<5.0 'これで、Algolia APIクライアントをプロジェクトにインポートしてプレイできます。
from algoliasearch . search . client import SearchClient
_client = SearchClient ( "YOUR_APP_ID" , "YOUR_API_KEY" )
# Add a new record to your Algolia index
response = await _client . save_object (
index_name = "<YOUR_INDEX_NAME>" ,
body = {
"objectID" : "id" ,
"test" : "val" ,
},
)
# use the class directly
print ( response )
# print the JSON response
print ( response . to_json ())
# Poll the task status to know when it has been indexed
await client . wait_for_task ( index_name = "<YOUR_INDEX_NAME>" , task_id = response . task_id )
# Fetch search results, with typo tolerance
response = await _client . search (
search_method_params = {
"requests" : [
{
"indexName" : "<YOUR_INDEX_NAME>" ,
"query" : "<YOUR_QUERY>" ,
"hitsPerPage" : 50 ,
},
],
},
)
# use the class directly
print ( response )
# print the JSON response
print ( response . to_json ())完全なドキュメントについては、 Algolia Python APIクライアントをご覧ください。
問題に遭遇しますか?サポートに手を差し伸べる前に、FAQに向かうことをお勧めします。ここでは、最も一般的な問題の回答とクライアントとのGotchasを見つけることをお勧めします。 GitHubの問題を開くこともできます
このリポジトリは、Python用の生成されたAlgolia APIクライアントのコードをホストします。貢献したい場合は、メインリポジトリにアクセスしてください。ドキュメントWebサイトで寄付ガイドを見つけることもできます。
Algolia Python APIクライアントは、MITライセンスに基づいてライセンスされているオープンソースのソフトウェアです。