1. Packages
  2. Algolia Provider
  3. API Docs
  4. Synonyms
algolia 0.6.0 published on Monday, Apr 14, 2025 by k-yomo

algolia.Synonyms

Explore with Pulumi AI

algolia logo
algolia 0.6.0 published on Monday, Apr 14, 2025 by k-yomo

    A configuration for synonyms. To get more information about synonyms, see the Official Documentation.

    It replaces any existing synonyms set for the index. So you can’t have multiple algolia.Synonyms resources for the same index.

    Create Synonyms Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Synonyms(name: string, args: SynonymsArgs, opts?: CustomResourceOptions);
    @overload
    def Synonyms(resource_name: str,
                 args: SynonymsArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Synonyms(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 index_name: Optional[str] = None,
                 synonyms: Optional[Sequence[SynonymsSynonymArgs]] = None,
                 synonyms_id: Optional[str] = None)
    func NewSynonyms(ctx *Context, name string, args SynonymsArgs, opts ...ResourceOption) (*Synonyms, error)
    public Synonyms(string name, SynonymsArgs args, CustomResourceOptions? opts = null)
    public Synonyms(String name, SynonymsArgs args)
    public Synonyms(String name, SynonymsArgs args, CustomResourceOptions options)
    
    type: algolia:Synonyms
    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 SynonymsArgs
    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 SynonymsArgs
    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 SynonymsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SynonymsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SynonymsArgs
    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 synonymsResource = new Algolia.Synonyms("synonymsResource", new()
    {
        IndexName = "string",
        Synonyms = new[]
        {
            new Algolia.Inputs.SynonymsSynonymArgs
            {
                ObjectId = "string",
                Type = "string",
                Corrections = new[]
                {
                    "string",
                },
                Input = "string",
                Placeholder = "string",
                Replacements = new[]
                {
                    "string",
                },
                Synonyms = new[]
                {
                    "string",
                },
                Word = "string",
            },
        },
        SynonymsId = "string",
    });
    
    example, err := algolia.NewSynonyms(ctx, "synonymsResource", &algolia.SynonymsArgs{
    	IndexName: pulumi.String("string"),
    	Synonyms: algolia.SynonymsSynonymArray{
    		&algolia.SynonymsSynonymArgs{
    			ObjectId: pulumi.String("string"),
    			Type:     pulumi.String("string"),
    			Corrections: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Input:       pulumi.String("string"),
    			Placeholder: pulumi.String("string"),
    			Replacements: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Synonyms: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Word: pulumi.String("string"),
    		},
    	},
    	SynonymsId: pulumi.String("string"),
    })
    
    var synonymsResource = new Synonyms("synonymsResource", SynonymsArgs.builder()
        .indexName("string")
        .synonyms(SynonymsSynonymArgs.builder()
            .objectId("string")
            .type("string")
            .corrections("string")
            .input("string")
            .placeholder("string")
            .replacements("string")
            .synonyms("string")
            .word("string")
            .build())
        .synonymsId("string")
        .build());
    
    synonyms_resource = algolia.Synonyms("synonymsResource",
        index_name="string",
        synonyms=[{
            "object_id": "string",
            "type": "string",
            "corrections": ["string"],
            "input": "string",
            "placeholder": "string",
            "replacements": ["string"],
            "synonyms": ["string"],
            "word": "string",
        }],
        synonyms_id="string")
    
    const synonymsResource = new algolia.Synonyms("synonymsResource", {
        indexName: "string",
        synonyms: [{
            objectId: "string",
            type: "string",
            corrections: ["string"],
            input: "string",
            placeholder: "string",
            replacements: ["string"],
            synonyms: ["string"],
            word: "string",
        }],
        synonymsId: "string",
    });
    
    type: algolia:Synonyms
    properties:
        indexName: string
        synonyms:
            - corrections:
                - string
              input: string
              objectId: string
              placeholder: string
              replacements:
                - string
              synonyms:
                - string
              type: string
              word: string
        synonymsId: string
    

    Synonyms 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 Synonyms resource accepts the following input properties:

    IndexName string
    Name of the index to apply synonyms.
    Synonyms List<SynonymsSynonym>
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    SynonymsId string
    The ID of this resource.
    IndexName string
    Name of the index to apply synonyms.
    Synonyms []SynonymsSynonymArgs
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    SynonymsId string
    The ID of this resource.
    indexName String
    Name of the index to apply synonyms.
    synonyms List<SynonymsSynonym>
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonymsId String
    The ID of this resource.
    indexName string
    Name of the index to apply synonyms.
    synonyms SynonymsSynonym[]
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonymsId string
    The ID of this resource.
    index_name str
    Name of the index to apply synonyms.
    synonyms Sequence[SynonymsSynonymArgs]
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonyms_id str
    The ID of this resource.
    indexName String
    Name of the index to apply synonyms.
    synonyms List<Property Map>
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonymsId String
    The ID of this resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Synonyms 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 Synonyms Resource

    Get an existing Synonyms 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?: SynonymsState, opts?: CustomResourceOptions): Synonyms
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            index_name: Optional[str] = None,
            synonyms: Optional[Sequence[SynonymsSynonymArgs]] = None,
            synonyms_id: Optional[str] = None) -> Synonyms
    func GetSynonyms(ctx *Context, name string, id IDInput, state *SynonymsState, opts ...ResourceOption) (*Synonyms, error)
    public static Synonyms Get(string name, Input<string> id, SynonymsState? state, CustomResourceOptions? opts = null)
    public static Synonyms get(String name, Output<String> id, SynonymsState state, CustomResourceOptions options)
    resources:  _:    type: algolia:Synonyms    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.
    The following state arguments are supported:
    IndexName string
    Name of the index to apply synonyms.
    Synonyms List<SynonymsSynonym>
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    SynonymsId string
    The ID of this resource.
    IndexName string
    Name of the index to apply synonyms.
    Synonyms []SynonymsSynonymArgs
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    SynonymsId string
    The ID of this resource.
    indexName String
    Name of the index to apply synonyms.
    synonyms List<SynonymsSynonym>
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonymsId String
    The ID of this resource.
    indexName string
    Name of the index to apply synonyms.
    synonyms SynonymsSynonym[]
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonymsId string
    The ID of this resource.
    index_name str
    Name of the index to apply synonyms.
    synonyms Sequence[SynonymsSynonymArgs]
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonyms_id str
    The ID of this resource.
    indexName String
    Name of the index to apply synonyms.
    synonyms List<Property Map>
    A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
    synonymsId String
    The ID of this resource.

    Supporting Types

    SynonymsSynonym, SynonymsSynonymArgs

    ObjectId string
    Unique identifier for the synonym.It can contain any character, and be of unlimited length.
    Type string
    The type of the synonym. Possible values are synonym, oneWaySynonym, altCorrection1, altCorrection2 and placeholder.
    Corrections List<string>
    List of corrections of the word. Required if type=altCorrection1 or type=altCorrection2
    Input string
    Defines the synonym. A word or expression, used as the basis for the array of synonyms. Required if type=oneWaySynonym.
    Placeholder string
    Single word, used as the basis for the below array of replacements. Required if type=placeholder
    Replacements List<string>
    List of replacements of the placeholder. Required if type=placeholder
    Synonyms List<string>
    List of synonyms (up to 20 for typesynonymand 100 for typeoneWaySynonym). Required if type=synonymor type=oneWaySynonym`.
    Word string
    Single word, used as the basis for the below array of corrections. Required if type=altCorrection1 or type=altCorrection2
    ObjectId string
    Unique identifier for the synonym.It can contain any character, and be of unlimited length.
    Type string
    The type of the synonym. Possible values are synonym, oneWaySynonym, altCorrection1, altCorrection2 and placeholder.
    Corrections []string
    List of corrections of the word. Required if type=altCorrection1 or type=altCorrection2
    Input string
    Defines the synonym. A word or expression, used as the basis for the array of synonyms. Required if type=oneWaySynonym.
    Placeholder string
    Single word, used as the basis for the below array of replacements. Required if type=placeholder
    Replacements []string
    List of replacements of the placeholder. Required if type=placeholder
    Synonyms []string
    List of synonyms (up to 20 for typesynonymand 100 for typeoneWaySynonym). Required if type=synonymor type=oneWaySynonym`.
    Word string
    Single word, used as the basis for the below array of corrections. Required if type=altCorrection1 or type=altCorrection2
    objectId String
    Unique identifier for the synonym.It can contain any character, and be of unlimited length.
    type String
    The type of the synonym. Possible values are synonym, oneWaySynonym, altCorrection1, altCorrection2 and placeholder.
    corrections List<String>
    List of corrections of the word. Required if type=altCorrection1 or type=altCorrection2
    input String
    Defines the synonym. A word or expression, used as the basis for the array of synonyms. Required if type=oneWaySynonym.
    placeholder String
    Single word, used as the basis for the below array of replacements. Required if type=placeholder
    replacements List<String>
    List of replacements of the placeholder. Required if type=placeholder
    synonyms List<String>
    List of synonyms (up to 20 for typesynonymand 100 for typeoneWaySynonym). Required if type=synonymor type=oneWaySynonym`.
    word String
    Single word, used as the basis for the below array of corrections. Required if type=altCorrection1 or type=altCorrection2
    objectId string
    Unique identifier for the synonym.It can contain any character, and be of unlimited length.
    type string
    The type of the synonym. Possible values are synonym, oneWaySynonym, altCorrection1, altCorrection2 and placeholder.
    corrections string[]
    List of corrections of the word. Required if type=altCorrection1 or type=altCorrection2
    input string
    Defines the synonym. A word or expression, used as the basis for the array of synonyms. Required if type=oneWaySynonym.
    placeholder string
    Single word, used as the basis for the below array of replacements. Required if type=placeholder
    replacements string[]
    List of replacements of the placeholder. Required if type=placeholder
    synonyms string[]
    List of synonyms (up to 20 for typesynonymand 100 for typeoneWaySynonym). Required if type=synonymor type=oneWaySynonym`.
    word string
    Single word, used as the basis for the below array of corrections. Required if type=altCorrection1 or type=altCorrection2
    object_id str
    Unique identifier for the synonym.It can contain any character, and be of unlimited length.
    type str
    The type of the synonym. Possible values are synonym, oneWaySynonym, altCorrection1, altCorrection2 and placeholder.
    corrections Sequence[str]
    List of corrections of the word. Required if type=altCorrection1 or type=altCorrection2
    input str
    Defines the synonym. A word or expression, used as the basis for the array of synonyms. Required if type=oneWaySynonym.
    placeholder str
    Single word, used as the basis for the below array of replacements. Required if type=placeholder
    replacements Sequence[str]
    List of replacements of the placeholder. Required if type=placeholder
    synonyms Sequence[str]
    List of synonyms (up to 20 for typesynonymand 100 for typeoneWaySynonym). Required if type=synonymor type=oneWaySynonym`.
    word str
    Single word, used as the basis for the below array of corrections. Required if type=altCorrection1 or type=altCorrection2
    objectId String
    Unique identifier for the synonym.It can contain any character, and be of unlimited length.
    type String
    The type of the synonym. Possible values are synonym, oneWaySynonym, altCorrection1, altCorrection2 and placeholder.
    corrections List<String>
    List of corrections of the word. Required if type=altCorrection1 or type=altCorrection2
    input String
    Defines the synonym. A word or expression, used as the basis for the array of synonyms. Required if type=oneWaySynonym.
    placeholder String
    Single word, used as the basis for the below array of replacements. Required if type=placeholder
    replacements List<String>
    List of replacements of the placeholder. Required if type=placeholder
    synonyms List<String>
    List of synonyms (up to 20 for typesynonymand 100 for typeoneWaySynonym). Required if type=synonymor type=oneWaySynonym`.
    word String
    Single word, used as the basis for the below array of corrections. Required if type=altCorrection1 or type=altCorrection2

    Import

    $ pulumi import algolia:index/synonyms:Synonyms default {{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.
    algolia logo
    algolia 0.6.0 published on Monday, Apr 14, 2025 by k-yomo