Sep 20, 2024
Create a configuration
Creates a new Query Suggestions configuration.
You can have up to 100 configurations per Algolia application.
Usage
Required ACL:
editSettings
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from algoliasearch.query_suggestions.client import QuerySuggestionsClientSync
from json import loads
# In an asynchronous context, you can use QuerySuggestionsClient instead, which exposes the exact same methods.
client = QuerySuggestionsClientSync(
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
)
response = client.create_config(
configuration_with_index={
"indexName": "ALGOLIA_INDEX_NAME",
"sourceIndices": [
{
"indexName": "ALGOLIA_INDEX_NAME",
"facets": [
{
"attribute": "test",
},
],
"generate": [
[
"facetA",
"facetB",
],
[
"facetC",
],
],
},
],
"languages": [
"french",
],
"exclude": [
"test",
],
},
)
Did you find this page helpful?