Sep 20, 2024
Run a Composition
Runs a query on a single composition and returns matching results.
Usage
Required ACL:
search
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
from algoliasearch.composition.client import CompositionClientSync
# In an asynchronous context, you can use CompositionClient instead, which exposes the exact same methods.
client = CompositionClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
response = client.search(
composition_id="foo",
request_body={
"params": {
"query": "batman",
},
},
)
Did you find this page helpful?