Create a configuration

Creates a new Query Suggestions configuration.

You can have up to 100 configurations per Algolia application.

Usage

Required ACL: editSettings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require "algolia"

client = Algolia::QuerySuggestionsClient.create(
  "ALGOLIA_APPLICATION_ID",
  "ALGOLIA_API_KEY",
  "ALGOLIA_APPLICATION_REGION"
)

response = client.create_config(
  Algolia::QuerySuggestions::ConfigurationWithIndex.new(
    index_name: "ALGOLIA_INDEX_NAME",
    source_indices: [
      Algolia::QuerySuggestions::SourceIndex.new(
        index_name: "ALGOLIA_INDEX_NAME",
        facets: [Algolia::QuerySuggestions::Facet.new(attribute: "test")],
        generate: [["facetA", "facetB"], ["facetC"]]
      )
    ],
    languages: ["french"],
    exclude: ["test"]
  )
)
Did you find this page helpful?