algoliasearch client python
4.9.2
문서 • Django • 커뮤니티 포럼 • 스택 오버플로 • 버그보고 • FAQ • 지원
3.8 의 파이썬을 지원합니다 먼저 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 클라이언트의 코드를 호스팅합니다. 기여하려면 기본 저장소로 이동하십시오. 문서 웹 사이트에서 기고 가이드를 찾을 수도 있습니다.
Algolia Python API 클라이언트는 MIT 라이센스에 따라 라이센스가 부여 된 오픈 소프트웨어입니다.