algoliasearch client python
4.9.2
เอกสาร• Django •ฟอรัมชุมชน•สแต็กล้น•รายงานข้อผิดพลาด•คำถามที่พบบ่อย•สนับสนุน
3.8 ขั้นแรกให้ติดตั้งไคลเอนต์ Algolia Python API ผ่าน PIP Package Manager:
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
พบปัญหา? ก่อนที่จะไปสนับสนุนเราขอแนะนำให้ไปที่คำถามที่พบบ่อยของเราซึ่งคุณจะพบคำตอบสำหรับปัญหาที่พบบ่อยที่สุดและ gotchas กับลูกค้า คุณยังสามารถเปิดปัญหา GitHub ได้
ที่เก็บนี้เป็นโฮสต์รหัสของไคลเอนต์ Algolia API ที่สร้างขึ้นสำหรับ Python หากคุณต้องการมีส่วนร่วมตรงไปที่ที่เก็บหลัก นอกจากนี้คุณยังสามารถหาคำแนะนำที่มีส่วนร่วมในเว็บไซต์เอกสารของเรา
ไคลเอ็นต์ Algolia Python API เป็นซอฟต์แวร์ที่ได้รับอนุญาตจากการเปิดใช้งานภายใต้ใบอนุญาต MIT