algolia.QuerySuggestions
Explore with Pulumi AI
A configuration that lies behind your Query Suggestions index.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as algolia from "@pulumi/algolia";
const exampleIndex = new algolia.Index("exampleIndex", {});
const exampleSource = new algolia.Index("exampleSource", {});
const exampleQuerySuggestions = new algolia.QuerySuggestions("exampleQuerySuggestions", {
indexName: exampleIndex.name,
sourceIndices: [{
indexName: exampleSource.name,
minHits: 10,
minLetters: 3,
generates: [
["brand"],
[
"brand",
"category",
],
],
}],
languages: [
"en",
"ja",
],
});
import pulumi
import pulumi_algolia as algolia
example_index = algolia.Index("exampleIndex")
example_source = algolia.Index("exampleSource")
example_query_suggestions = algolia.QuerySuggestions("exampleQuerySuggestions",
index_name=example_index.name,
source_indices=[{
"index_name": example_source.name,
"min_hits": 10,
"min_letters": 3,
"generates": [
["brand"],
[
"brand",
"category",
],
],
}],
languages=[
"en",
"ja",
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/algolia/algolia"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleIndex, err := algolia.NewIndex(ctx, "exampleIndex", nil)
if err != nil {
return err
}
exampleSource, err := algolia.NewIndex(ctx, "exampleSource", nil)
if err != nil {
return err
}
_, err = algolia.NewQuerySuggestions(ctx, "exampleQuerySuggestions", &algolia.QuerySuggestionsArgs{
IndexName: exampleIndex.Name,
SourceIndices: algolia.QuerySuggestionsSourceIndexArray{
&algolia.QuerySuggestionsSourceIndexArgs{
IndexName: exampleSource.Name,
MinHits: pulumi.Float64(10),
MinLetters: pulumi.Float64(3),
Generates: pulumi.StringArrayArray{
pulumi.StringArray{
pulumi.String("brand"),
},
pulumi.StringArray{
pulumi.String("brand"),
pulumi.String("category"),
},
},
},
},
Languages: pulumi.StringArray{
pulumi.String("en"),
pulumi.String("ja"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Algolia = Pulumi.Algolia;
return await Deployment.RunAsync(() =>
{
var exampleIndex = new Algolia.Index("exampleIndex");
var exampleSource = new Algolia.Index("exampleSource");
var exampleQuerySuggestions = new Algolia.QuerySuggestions("exampleQuerySuggestions", new()
{
IndexName = exampleIndex.Name,
SourceIndices = new[]
{
new Algolia.Inputs.QuerySuggestionsSourceIndexArgs
{
IndexName = exampleSource.Name,
MinHits = 10,
MinLetters = 3,
Generates = new[]
{
new[]
{
"brand",
},
new[]
{
"brand",
"category",
},
},
},
},
Languages = new[]
{
"en",
"ja",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.algolia.Index;
import com.pulumi.algolia.QuerySuggestions;
import com.pulumi.algolia.QuerySuggestionsArgs;
import com.pulumi.algolia.inputs.QuerySuggestionsSourceIndexArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleIndex = new Index("exampleIndex");
var exampleSource = new Index("exampleSource");
var exampleQuerySuggestions = new QuerySuggestions("exampleQuerySuggestions", QuerySuggestionsArgs.builder()
.indexName(exampleIndex.name())
.sourceIndices(QuerySuggestionsSourceIndexArgs.builder()
.indexName(exampleSource.name())
.minHits(10)
.minLetters(3)
.generates(
"brand",
"brand",
"category")
.build())
.languages(
"en",
"ja")
.build());
}
}
resources:
exampleIndex:
type: algolia:Index
exampleSource:
type: algolia:Index
exampleQuerySuggestions:
type: algolia:QuerySuggestions
properties:
indexName: ${exampleIndex.name}
sourceIndices:
- indexName: ${exampleSource.name}
minHits: 10
minLetters: 3
generates:
- - brand
- - brand
- category
languages:
- en
- ja
Create QuerySuggestions Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new QuerySuggestions(name: string, args: QuerySuggestionsArgs, opts?: CustomResourceOptions);
@overload
def QuerySuggestions(resource_name: str,
args: QuerySuggestionsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def QuerySuggestions(resource_name: str,
opts: Optional[ResourceOptions] = None,
index_name: Optional[str] = None,
source_indices: Optional[Sequence[QuerySuggestionsSourceIndexArgs]] = None,
excludes: Optional[Sequence[str]] = None,
languages: Optional[Sequence[str]] = None,
query_suggestions_id: Optional[str] = None,
region: Optional[str] = None)
func NewQuerySuggestions(ctx *Context, name string, args QuerySuggestionsArgs, opts ...ResourceOption) (*QuerySuggestions, error)
public QuerySuggestions(string name, QuerySuggestionsArgs args, CustomResourceOptions? opts = null)
public QuerySuggestions(String name, QuerySuggestionsArgs args)
public QuerySuggestions(String name, QuerySuggestionsArgs args, CustomResourceOptions options)
type: algolia:QuerySuggestions
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args QuerySuggestionsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args QuerySuggestionsArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args QuerySuggestionsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args QuerySuggestionsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args QuerySuggestionsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var querySuggestionsResource = new Algolia.QuerySuggestions("querySuggestionsResource", new()
{
IndexName = "string",
SourceIndices = new[]
{
new Algolia.Inputs.QuerySuggestionsSourceIndexArgs
{
IndexName = "string",
AnalyticsTags = new[]
{
"string",
},
Externals = new[]
{
"string",
},
Facets = new[]
{
new Algolia.Inputs.QuerySuggestionsSourceIndexFacetArgs
{
Amount = 0,
Attribute = "string",
},
},
Generates = new[]
{
new[]
{
"string",
},
},
MinHits = 0,
MinLetters = 0,
},
},
Excludes = new[]
{
"string",
},
Languages = new[]
{
"string",
},
QuerySuggestionsId = "string",
Region = "string",
});
example, err := algolia.NewQuerySuggestions(ctx, "querySuggestionsResource", &algolia.QuerySuggestionsArgs{
IndexName: pulumi.String("string"),
SourceIndices: algolia.QuerySuggestionsSourceIndexArray{
&algolia.QuerySuggestionsSourceIndexArgs{
IndexName: pulumi.String("string"),
AnalyticsTags: pulumi.StringArray{
pulumi.String("string"),
},
Externals: pulumi.StringArray{
pulumi.String("string"),
},
Facets: algolia.QuerySuggestionsSourceIndexFacetArray{
&algolia.QuerySuggestionsSourceIndexFacetArgs{
Amount: pulumi.Float64(0),
Attribute: pulumi.String("string"),
},
},
Generates: pulumi.StringArrayArray{
pulumi.StringArray{
pulumi.String("string"),
},
},
MinHits: pulumi.Float64(0),
MinLetters: pulumi.Float64(0),
},
},
Excludes: pulumi.StringArray{
pulumi.String("string"),
},
Languages: pulumi.StringArray{
pulumi.String("string"),
},
QuerySuggestionsId: pulumi.String("string"),
Region: pulumi.String("string"),
})
var querySuggestionsResource = new QuerySuggestions("querySuggestionsResource", QuerySuggestionsArgs.builder()
.indexName("string")
.sourceIndices(QuerySuggestionsSourceIndexArgs.builder()
.indexName("string")
.analyticsTags("string")
.externals("string")
.facets(QuerySuggestionsSourceIndexFacetArgs.builder()
.amount(0)
.attribute("string")
.build())
.generates("string")
.minHits(0)
.minLetters(0)
.build())
.excludes("string")
.languages("string")
.querySuggestionsId("string")
.region("string")
.build());
query_suggestions_resource = algolia.QuerySuggestions("querySuggestionsResource",
index_name="string",
source_indices=[{
"index_name": "string",
"analytics_tags": ["string"],
"externals": ["string"],
"facets": [{
"amount": 0,
"attribute": "string",
}],
"generates": [["string"]],
"min_hits": 0,
"min_letters": 0,
}],
excludes=["string"],
languages=["string"],
query_suggestions_id="string",
region="string")
const querySuggestionsResource = new algolia.QuerySuggestions("querySuggestionsResource", {
indexName: "string",
sourceIndices: [{
indexName: "string",
analyticsTags: ["string"],
externals: ["string"],
facets: [{
amount: 0,
attribute: "string",
}],
generates: [["string"]],
minHits: 0,
minLetters: 0,
}],
excludes: ["string"],
languages: ["string"],
querySuggestionsId: "string",
region: "string",
});
type: algolia:QuerySuggestions
properties:
excludes:
- string
indexName: string
languages:
- string
querySuggestionsId: string
region: string
sourceIndices:
- analyticsTags:
- string
externals:
- string
facets:
- amount: 0
attribute: string
generates:
- - string
indexName: string
minHits: 0
minLetters: 0
QuerySuggestions Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The QuerySuggestions resource accepts the following input properties:
- Index
Name string - Index name to target.
- Source
Indices List<QuerySuggestions Source Index> - A list of source indices used to generate a Query Suggestions index.
- Excludes List<string>
- A list of words and patterns to exclude from the Query Suggestions index.
- Languages List<string>
- A list of languages used to de-duplicate singular and plural suggestions.
- Query
Suggestions stringId - The ID of this resource.
- Region string
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- Index
Name string - Index name to target.
- Source
Indices []QuerySuggestions Source Index Args - A list of source indices used to generate a Query Suggestions index.
- Excludes []string
- A list of words and patterns to exclude from the Query Suggestions index.
- Languages []string
- A list of languages used to de-duplicate singular and plural suggestions.
- Query
Suggestions stringId - The ID of this resource.
- Region string
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- index
Name String - Index name to target.
- source
Indices List<QuerySuggestions Source Index> - A list of source indices used to generate a Query Suggestions index.
- excludes List<String>
- A list of words and patterns to exclude from the Query Suggestions index.
- languages List<String>
- A list of languages used to de-duplicate singular and plural suggestions.
- query
Suggestions StringId - The ID of this resource.
- region String
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- index
Name string - Index name to target.
- source
Indices QuerySuggestions Source Index[] - A list of source indices used to generate a Query Suggestions index.
- excludes string[]
- A list of words and patterns to exclude from the Query Suggestions index.
- languages string[]
- A list of languages used to de-duplicate singular and plural suggestions.
- query
Suggestions stringId - The ID of this resource.
- region string
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- index_
name str - Index name to target.
- source_
indices Sequence[QuerySuggestions Source Index Args] - A list of source indices used to generate a Query Suggestions index.
- excludes Sequence[str]
- A list of words and patterns to exclude from the Query Suggestions index.
- languages Sequence[str]
- A list of languages used to de-duplicate singular and plural suggestions.
- query_
suggestions_ strid - The ID of this resource.
- region str
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- index
Name String - Index name to target.
- source
Indices List<Property Map> - A list of source indices used to generate a Query Suggestions index.
- excludes List<String>
- A list of words and patterns to exclude from the Query Suggestions index.
- languages List<String>
- A list of languages used to de-duplicate singular and plural suggestions.
- query
Suggestions StringId - The ID of this resource.
- region String
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
Outputs
All input properties are implicitly available as output properties. Additionally, the QuerySuggestions resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing QuerySuggestions Resource
Get an existing QuerySuggestions resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: QuerySuggestionsState, opts?: CustomResourceOptions): QuerySuggestions
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
excludes: Optional[Sequence[str]] = None,
index_name: Optional[str] = None,
languages: Optional[Sequence[str]] = None,
query_suggestions_id: Optional[str] = None,
region: Optional[str] = None,
source_indices: Optional[Sequence[QuerySuggestionsSourceIndexArgs]] = None) -> QuerySuggestions
func GetQuerySuggestions(ctx *Context, name string, id IDInput, state *QuerySuggestionsState, opts ...ResourceOption) (*QuerySuggestions, error)
public static QuerySuggestions Get(string name, Input<string> id, QuerySuggestionsState? state, CustomResourceOptions? opts = null)
public static QuerySuggestions get(String name, Output<String> id, QuerySuggestionsState state, CustomResourceOptions options)
resources: _: type: algolia:QuerySuggestions get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Excludes List<string>
- A list of words and patterns to exclude from the Query Suggestions index.
- Index
Name string - Index name to target.
- Languages List<string>
- A list of languages used to de-duplicate singular and plural suggestions.
- Query
Suggestions stringId - The ID of this resource.
- Region string
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- Source
Indices List<QuerySuggestions Source Index> - A list of source indices used to generate a Query Suggestions index.
- Excludes []string
- A list of words and patterns to exclude from the Query Suggestions index.
- Index
Name string - Index name to target.
- Languages []string
- A list of languages used to de-duplicate singular and plural suggestions.
- Query
Suggestions stringId - The ID of this resource.
- Region string
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- Source
Indices []QuerySuggestions Source Index Args - A list of source indices used to generate a Query Suggestions index.
- excludes List<String>
- A list of words and patterns to exclude from the Query Suggestions index.
- index
Name String - Index name to target.
- languages List<String>
- A list of languages used to de-duplicate singular and plural suggestions.
- query
Suggestions StringId - The ID of this resource.
- region String
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- source
Indices List<QuerySuggestions Source Index> - A list of source indices used to generate a Query Suggestions index.
- excludes string[]
- A list of words and patterns to exclude from the Query Suggestions index.
- index
Name string - Index name to target.
- languages string[]
- A list of languages used to de-duplicate singular and plural suggestions.
- query
Suggestions stringId - The ID of this resource.
- region string
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- source
Indices QuerySuggestions Source Index[] - A list of source indices used to generate a Query Suggestions index.
- excludes Sequence[str]
- A list of words and patterns to exclude from the Query Suggestions index.
- index_
name str - Index name to target.
- languages Sequence[str]
- A list of languages used to de-duplicate singular and plural suggestions.
- query_
suggestions_ strid - The ID of this resource.
- region str
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- source_
indices Sequence[QuerySuggestions Source Index Args] - A list of source indices used to generate a Query Suggestions index.
- excludes List<String>
- A list of words and patterns to exclude from the Query Suggestions index.
- index
Name String - Index name to target.
- languages List<String>
- A list of languages used to de-duplicate singular and plural suggestions.
- query
Suggestions StringId - The ID of this resource.
- region String
- Region to create the index in. "us", "eu", "de" are supported. Defaults to "us" when not specified.
- source
Indices List<Property Map> - A list of source indices used to generate a Query Suggestions index.
Supporting Types
QuerySuggestionsSourceIndex, QuerySuggestionsSourceIndexArgs
- Index
Name string - Index name to target.
- List<string>
- A list of analytics tags to filter the popular searches per tag.
- Externals List<string>
- A list of external indices to use to generate custom Query Suggestions.
- Facets
List<Query
Suggestions Source Index Facet> - A list of facets to define as categories for the query suggestions.
- Generates
List<Immutable
Array<string>> - List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list
(e.g., (facetA and facetB) and facetC).
[ ["facetA", "facetB"], ["facetC"] ]
- Min
Hits double - Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
- Min
Letters double - Minimum number of required letters for a suggestion to remain.
- Index
Name string - Index name to target.
- []string
- A list of analytics tags to filter the popular searches per tag.
- Externals []string
- A list of external indices to use to generate custom Query Suggestions.
- Facets
[]Query
Suggestions Source Index Facet - A list of facets to define as categories for the query suggestions.
- Generates [][]string
- List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list
(e.g., (facetA and facetB) and facetC).
[ ["facetA", "facetB"], ["facetC"] ]
- Min
Hits float64 - Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
- Min
Letters float64 - Minimum number of required letters for a suggestion to remain.
- index
Name String - Index name to target.
- List<String>
- A list of analytics tags to filter the popular searches per tag.
- externals List<String>
- A list of external indices to use to generate custom Query Suggestions.
- facets
List<Query
Suggestions Source Index Facet> - A list of facets to define as categories for the query suggestions.
- generates List<List<String>>
- List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list
(e.g., (facetA and facetB) and facetC).
[ ["facetA", "facetB"], ["facetC"] ]
- min
Hits Double - Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
- min
Letters Double - Minimum number of required letters for a suggestion to remain.
- index
Name string - Index name to target.
- string[]
- A list of analytics tags to filter the popular searches per tag.
- externals string[]
- A list of external indices to use to generate custom Query Suggestions.
- facets
Query
Suggestions Source Index Facet[] - A list of facets to define as categories for the query suggestions.
- generates string[][]
- List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list
(e.g., (facetA and facetB) and facetC).
[ ["facetA", "facetB"], ["facetC"] ]
- min
Hits number - Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
- min
Letters number - Minimum number of required letters for a suggestion to remain.
- index_
name str - Index name to target.
- Sequence[str]
- A list of analytics tags to filter the popular searches per tag.
- externals Sequence[str]
- A list of external indices to use to generate custom Query Suggestions.
- facets
Sequence[Query
Suggestions Source Index Facet] - A list of facets to define as categories for the query suggestions.
- generates Sequence[Sequence[str]]
- List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list
(e.g., (facetA and facetB) and facetC).
[ ["facetA", "facetB"], ["facetC"] ]
- min_
hits float - Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
- min_
letters float - Minimum number of required letters for a suggestion to remain.
- index
Name String - Index name to target.
- List<String>
- A list of analytics tags to filter the popular searches per tag.
- externals List<String>
- A list of external indices to use to generate custom Query Suggestions.
- facets List<Property Map>
- A list of facets to define as categories for the query suggestions.
- generates List<List<String>>
- List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list
(e.g., (facetA and facetB) and facetC).
[ ["facetA", "facetB"], ["facetC"] ]
- min
Hits Number - Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
- min
Letters Number - Minimum number of required letters for a suggestion to remain.
QuerySuggestionsSourceIndexFacet, QuerySuggestionsSourceIndexFacetArgs
Import
$ pulumi import algolia:index/querySuggestions:QuerySuggestions default {{region}}/{{index_name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- algolia k-yomo/terraform-provider-algolia
- License
- Notes
- This Pulumi package is based on the
algolia
Terraform Provider.