algolia.Rule
Explore with Pulumi AI
A configuration for a Rule. To get more information about rules, see the Official Documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as algolia from "@pulumi/algolia";
const example = new algolia.Rule("example", {
conditions: [{
anchoring: "contains",
pattern: "{facet:category}",
}],
consequence: {
params: {
automaticFacetFilters: [{
disjunctive: true,
facet: "category",
}],
},
},
indexName: "example_index",
objectId: "example",
});
import pulumi
import pulumi_algolia as algolia
example = algolia.Rule("example",
conditions=[{
"anchoring": "contains",
"pattern": "{facet:category}",
}],
consequence={
"params": {
"automatic_facet_filters": [{
"disjunctive": True,
"facet": "category",
}],
},
},
index_name="example_index",
object_id="example")
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 {
_, err := algolia.NewRule(ctx, "example", &algolia.RuleArgs{
Conditions: algolia.RuleConditionArray{
&algolia.RuleConditionArgs{
Anchoring: pulumi.String("contains"),
Pattern: pulumi.String("{facet:category}"),
},
},
Consequence: &algolia.RuleConsequenceArgs{
Params: &algolia.RuleConsequenceParamsArgs{
AutomaticFacetFilters: algolia.RuleConsequenceParamsAutomaticFacetFilterArray{
&algolia.RuleConsequenceParamsAutomaticFacetFilterArgs{
Disjunctive: pulumi.Bool(true),
Facet: pulumi.String("category"),
},
},
},
},
IndexName: pulumi.String("example_index"),
ObjectId: pulumi.String("example"),
})
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 example = new Algolia.Rule("example", new()
{
Conditions = new[]
{
new Algolia.Inputs.RuleConditionArgs
{
Anchoring = "contains",
Pattern = "{facet:category}",
},
},
Consequence = new Algolia.Inputs.RuleConsequenceArgs
{
Params = new Algolia.Inputs.RuleConsequenceParamsArgs
{
AutomaticFacetFilters = new[]
{
new Algolia.Inputs.RuleConsequenceParamsAutomaticFacetFilterArgs
{
Disjunctive = true,
Facet = "category",
},
},
},
},
IndexName = "example_index",
ObjectId = "example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.algolia.Rule;
import com.pulumi.algolia.RuleArgs;
import com.pulumi.algolia.inputs.RuleConditionArgs;
import com.pulumi.algolia.inputs.RuleConsequenceArgs;
import com.pulumi.algolia.inputs.RuleConsequenceParamsArgs;
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 example = new Rule("example", RuleArgs.builder()
.conditions(RuleConditionArgs.builder()
.anchoring("contains")
.pattern("{facet:category}")
.build())
.consequence(RuleConsequenceArgs.builder()
.params(RuleConsequenceParamsArgs.builder()
.automaticFacetFilters(RuleConsequenceParamsAutomaticFacetFilterArgs.builder()
.disjunctive(true)
.facet("category")
.build())
.build())
.build())
.indexName("example_index")
.objectId("example")
.build());
}
}
resources:
example:
type: algolia:Rule
properties:
conditions:
- anchoring: contains
pattern: '{facet:category}'
consequence:
params:
automaticFacetFilters:
- disjunctive: true
facet: category
indexName: example_index
objectId: example
Create Rule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);
@overload
def Rule(resource_name: str,
args: RuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Rule(resource_name: str,
opts: Optional[ResourceOptions] = None,
consequence: Optional[RuleConsequenceArgs] = None,
index_name: Optional[str] = None,
object_id: Optional[str] = None,
conditions: Optional[Sequence[RuleConditionArgs]] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
rule_id: Optional[str] = None,
validities: Optional[Sequence[RuleValidityArgs]] = None)
func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)
public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)
type: algolia:Rule
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 RuleArgs
- 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 RuleArgs
- 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 RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RuleArgs
- 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 ruleResource = new Algolia.Rule("ruleResource", new()
{
Consequence = new Algolia.Inputs.RuleConsequenceArgs
{
Hides = new[]
{
"string",
},
ParamsJson = "string",
Promotes = new[]
{
new Algolia.Inputs.RuleConsequencePromoteArgs
{
ObjectIds = new[]
{
"string",
},
Position = 0,
},
},
UserData = "string",
},
IndexName = "string",
ObjectId = "string",
Conditions = new[]
{
new Algolia.Inputs.RuleConditionArgs
{
Alternatives = false,
Anchoring = "string",
Context = "string",
Pattern = "string",
},
},
Description = "string",
Enabled = false,
RuleId = "string",
Validities = new[]
{
new Algolia.Inputs.RuleValidityArgs
{
From = "string",
Until = "string",
},
},
});
example, err := algolia.NewRule(ctx, "ruleResource", &algolia.RuleArgs{
Consequence: &algolia.RuleConsequenceArgs{
Hides: pulumi.StringArray{
pulumi.String("string"),
},
ParamsJson: pulumi.String("string"),
Promotes: algolia.RuleConsequencePromoteArray{
&algolia.RuleConsequencePromoteArgs{
ObjectIds: pulumi.StringArray{
pulumi.String("string"),
},
Position: pulumi.Float64(0),
},
},
UserData: pulumi.String("string"),
},
IndexName: pulumi.String("string"),
ObjectId: pulumi.String("string"),
Conditions: algolia.RuleConditionArray{
&algolia.RuleConditionArgs{
Alternatives: pulumi.Bool(false),
Anchoring: pulumi.String("string"),
Context: pulumi.String("string"),
Pattern: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
Enabled: pulumi.Bool(false),
RuleId: pulumi.String("string"),
Validities: algolia.RuleValidityArray{
&algolia.RuleValidityArgs{
From: pulumi.String("string"),
Until: pulumi.String("string"),
},
},
})
var ruleResource = new Rule("ruleResource", RuleArgs.builder()
.consequence(RuleConsequenceArgs.builder()
.hides("string")
.paramsJson("string")
.promotes(RuleConsequencePromoteArgs.builder()
.objectIds("string")
.position(0)
.build())
.userData("string")
.build())
.indexName("string")
.objectId("string")
.conditions(RuleConditionArgs.builder()
.alternatives(false)
.anchoring("string")
.context("string")
.pattern("string")
.build())
.description("string")
.enabled(false)
.ruleId("string")
.validities(RuleValidityArgs.builder()
.from("string")
.until("string")
.build())
.build());
rule_resource = algolia.Rule("ruleResource",
consequence={
"hides": ["string"],
"params_json": "string",
"promotes": [{
"object_ids": ["string"],
"position": 0,
}],
"user_data": "string",
},
index_name="string",
object_id="string",
conditions=[{
"alternatives": False,
"anchoring": "string",
"context": "string",
"pattern": "string",
}],
description="string",
enabled=False,
rule_id="string",
validities=[{
"from_": "string",
"until": "string",
}])
const ruleResource = new algolia.Rule("ruleResource", {
consequence: {
hides: ["string"],
paramsJson: "string",
promotes: [{
objectIds: ["string"],
position: 0,
}],
userData: "string",
},
indexName: "string",
objectId: "string",
conditions: [{
alternatives: false,
anchoring: "string",
context: "string",
pattern: "string",
}],
description: "string",
enabled: false,
ruleId: "string",
validities: [{
from: "string",
until: "string",
}],
});
type: algolia:Rule
properties:
conditions:
- alternatives: false
anchoring: string
context: string
pattern: string
consequence:
hides:
- string
paramsJson: string
promotes:
- objectIds:
- string
position: 0
userData: string
description: string
enabled: false
indexName: string
objectId: string
ruleId: string
validities:
- from: string
until: string
Rule 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 Rule resource accepts the following input properties:
- Consequence
Rule
Consequence - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- Index
Name string - Name of the index to apply rule.
- Object
Id string - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - Conditions
List<Rule
Condition> - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- Description string
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- Enabled bool
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- Rule
Id string - Validities
List<Rule
Validity> - Objects to promote as hits.
- Consequence
Rule
Consequence Args - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- Index
Name string - Name of the index to apply rule.
- Object
Id string - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - Conditions
[]Rule
Condition Args - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- Description string
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- Enabled bool
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- Rule
Id string - Validities
[]Rule
Validity Args - Objects to promote as hits.
- consequence
Rule
Consequence - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- index
Name String - Name of the index to apply rule.
- object
Id String - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - conditions
List<Rule
Condition> - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- description String
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled Boolean
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- rule
Id String - validities
List<Rule
Validity> - Objects to promote as hits.
- consequence
Rule
Consequence - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- index
Name string - Name of the index to apply rule.
- object
Id string - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - conditions
Rule
Condition[] - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- description string
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled boolean
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- rule
Id string - validities
Rule
Validity[] - Objects to promote as hits.
- consequence
Rule
Consequence Args - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- index_
name str - Name of the index to apply rule.
- object_
id str - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - conditions
Sequence[Rule
Condition Args] - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- description str
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled bool
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- rule_
id str - validities
Sequence[Rule
Validity Args] - Objects to promote as hits.
- consequence Property Map
- Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- index
Name String - Name of the index to apply rule.
- object
Id String - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - conditions List<Property Map>
- A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- description String
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled Boolean
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- rule
Id String - validities List<Property Map>
- Objects to promote as hits.
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule 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 Rule Resource
Get an existing Rule 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?: RuleState, opts?: CustomResourceOptions): Rule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
conditions: Optional[Sequence[RuleConditionArgs]] = None,
consequence: Optional[RuleConsequenceArgs] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
index_name: Optional[str] = None,
object_id: Optional[str] = None,
rule_id: Optional[str] = None,
validities: Optional[Sequence[RuleValidityArgs]] = None) -> Rule
func GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)
public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)
public static Rule get(String name, Output<String> id, RuleState state, CustomResourceOptions options)
resources: _: type: algolia:Rule 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.
- Conditions
List<Rule
Condition> - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- Consequence
Rule
Consequence - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- Description string
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- Enabled bool
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- Index
Name string - Name of the index to apply rule.
- Object
Id string - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - Rule
Id string - Validities
List<Rule
Validity> - Objects to promote as hits.
- Conditions
[]Rule
Condition Args - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- Consequence
Rule
Consequence Args - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- Description string
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- Enabled bool
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- Index
Name string - Name of the index to apply rule.
- Object
Id string - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - Rule
Id string - Validities
[]Rule
Validity Args - Objects to promote as hits.
- conditions
List<Rule
Condition> - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- consequence
Rule
Consequence - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- description String
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled Boolean
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- index
Name String - Name of the index to apply rule.
- object
Id String - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - rule
Id String - validities
List<Rule
Validity> - Objects to promote as hits.
- conditions
Rule
Condition[] - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- consequence
Rule
Consequence - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- description string
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled boolean
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- index
Name string - Name of the index to apply rule.
- object
Id string - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - rule
Id string - validities
Rule
Validity[] - Objects to promote as hits.
- conditions
Sequence[Rule
Condition Args] - A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- consequence
Rule
Consequence Args - Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- description str
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled bool
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- index_
name str - Name of the index to apply rule.
- object_
id str - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - rule_
id str - validities
Sequence[Rule
Validity Args] - Objects to promote as hits.
- conditions List<Property Map>
- A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule.
- consequence Property Map
- Consequence of the Rule. At least one of the following object must be used: - params - promote - hide - user_data
- description String
- This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It is not interpreted by the API.
- enabled Boolean
- Whether the Rule is enabled. Disabled Rules remain in the index, but are not applied at query time.
- index
Name String - Name of the index to apply rule.
- object
Id String - Unique identifier for the Rule (format:
[A-Za-z0-9_-]+
). - rule
Id String - validities List<Property Map>
- Objects to promote as hits.
Supporting Types
RuleCondition, RuleConditionArgs
- Alternatives bool
Whether the
pattern
matches on plurals, synonyms, and typos.This parameter goes hand in hand with the
pattern
parameter. If thepattern
is “shoe” andalternatives
istrue
, thepattern
matches on “shoes”, as well as synonyms and typos of “shoe”.- Anchoring string
Whether the pattern parameter must match the beginning or the end of the query string, or both, or none. Possible values are
is
,startsWith
,endsWith
andcontains
. This parameter goes hand in hand with thepattern
parameter. If you’re creating a Rule that depends on a specific query, you must specify thepattern
andanchoring
.Otherwise, you can omit both.
- Context string
- Rule context (format:
[A-Za-z0-9_-]+
). When specified, the Rule is only applied when the same context is specified at query time (using theruleContexts
parameter). When absent, the Rule is generic and always applies (provided that its other conditions are met, of course). - Pattern string
Query pattern syntax. Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens, which can be either:
- Facet value placeholder:
{facet:$facet_name}
. Example:{facet:brand}
. - Literal: the world itself. Example: Algolia.
Special characters (
*
,{
,}
,:
and\
) must be escaped by preceding them with a backslash () if they are to be treated as literals.
This parameter goes hand in hand with the
anchoring
parameter. If you’re creating a Rule that depends on a specific query, you must specify the pattern and anchoring. The empty""
pattern is only allowed whenanchoring
is set tois
.Otherwise, you can omit both.
- Facet value placeholder:
- Alternatives bool
Whether the
pattern
matches on plurals, synonyms, and typos.This parameter goes hand in hand with the
pattern
parameter. If thepattern
is “shoe” andalternatives
istrue
, thepattern
matches on “shoes”, as well as synonyms and typos of “shoe”.- Anchoring string
Whether the pattern parameter must match the beginning or the end of the query string, or both, or none. Possible values are
is
,startsWith
,endsWith
andcontains
. This parameter goes hand in hand with thepattern
parameter. If you’re creating a Rule that depends on a specific query, you must specify thepattern
andanchoring
.Otherwise, you can omit both.
- Context string
- Rule context (format:
[A-Za-z0-9_-]+
). When specified, the Rule is only applied when the same context is specified at query time (using theruleContexts
parameter). When absent, the Rule is generic and always applies (provided that its other conditions are met, of course). - Pattern string
Query pattern syntax. Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens, which can be either:
- Facet value placeholder:
{facet:$facet_name}
. Example:{facet:brand}
. - Literal: the world itself. Example: Algolia.
Special characters (
*
,{
,}
,:
and\
) must be escaped by preceding them with a backslash () if they are to be treated as literals.
This parameter goes hand in hand with the
anchoring
parameter. If you’re creating a Rule that depends on a specific query, you must specify the pattern and anchoring. The empty""
pattern is only allowed whenanchoring
is set tois
.Otherwise, you can omit both.
- Facet value placeholder:
- alternatives Boolean
Whether the
pattern
matches on plurals, synonyms, and typos.This parameter goes hand in hand with the
pattern
parameter. If thepattern
is “shoe” andalternatives
istrue
, thepattern
matches on “shoes”, as well as synonyms and typos of “shoe”.- anchoring String
Whether the pattern parameter must match the beginning or the end of the query string, or both, or none. Possible values are
is
,startsWith
,endsWith
andcontains
. This parameter goes hand in hand with thepattern
parameter. If you’re creating a Rule that depends on a specific query, you must specify thepattern
andanchoring
.Otherwise, you can omit both.
- context String
- Rule context (format:
[A-Za-z0-9_-]+
). When specified, the Rule is only applied when the same context is specified at query time (using theruleContexts
parameter). When absent, the Rule is generic and always applies (provided that its other conditions are met, of course). - pattern String
Query pattern syntax. Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens, which can be either:
- Facet value placeholder:
{facet:$facet_name}
. Example:{facet:brand}
. - Literal: the world itself. Example: Algolia.
Special characters (
*
,{
,}
,:
and\
) must be escaped by preceding them with a backslash () if they are to be treated as literals.
This parameter goes hand in hand with the
anchoring
parameter. If you’re creating a Rule that depends on a specific query, you must specify the pattern and anchoring. The empty""
pattern is only allowed whenanchoring
is set tois
.Otherwise, you can omit both.
- Facet value placeholder:
- alternatives boolean
Whether the
pattern
matches on plurals, synonyms, and typos.This parameter goes hand in hand with the
pattern
parameter. If thepattern
is “shoe” andalternatives
istrue
, thepattern
matches on “shoes”, as well as synonyms and typos of “shoe”.- anchoring string
Whether the pattern parameter must match the beginning or the end of the query string, or both, or none. Possible values are
is
,startsWith
,endsWith
andcontains
. This parameter goes hand in hand with thepattern
parameter. If you’re creating a Rule that depends on a specific query, you must specify thepattern
andanchoring
.Otherwise, you can omit both.
- context string
- Rule context (format:
[A-Za-z0-9_-]+
). When specified, the Rule is only applied when the same context is specified at query time (using theruleContexts
parameter). When absent, the Rule is generic and always applies (provided that its other conditions are met, of course). - pattern string
Query pattern syntax. Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens, which can be either:
- Facet value placeholder:
{facet:$facet_name}
. Example:{facet:brand}
. - Literal: the world itself. Example: Algolia.
Special characters (
*
,{
,}
,:
and\
) must be escaped by preceding them with a backslash () if they are to be treated as literals.
This parameter goes hand in hand with the
anchoring
parameter. If you’re creating a Rule that depends on a specific query, you must specify the pattern and anchoring. The empty""
pattern is only allowed whenanchoring
is set tois
.Otherwise, you can omit both.
- Facet value placeholder:
- alternatives bool
Whether the
pattern
matches on plurals, synonyms, and typos.This parameter goes hand in hand with the
pattern
parameter. If thepattern
is “shoe” andalternatives
istrue
, thepattern
matches on “shoes”, as well as synonyms and typos of “shoe”.- anchoring str
Whether the pattern parameter must match the beginning or the end of the query string, or both, or none. Possible values are
is
,startsWith
,endsWith
andcontains
. This parameter goes hand in hand with thepattern
parameter. If you’re creating a Rule that depends on a specific query, you must specify thepattern
andanchoring
.Otherwise, you can omit both.
- context str
- Rule context (format:
[A-Za-z0-9_-]+
). When specified, the Rule is only applied when the same context is specified at query time (using theruleContexts
parameter). When absent, the Rule is generic and always applies (provided that its other conditions are met, of course). - pattern str
Query pattern syntax. Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens, which can be either:
- Facet value placeholder:
{facet:$facet_name}
. Example:{facet:brand}
. - Literal: the world itself. Example: Algolia.
Special characters (
*
,{
,}
,:
and\
) must be escaped by preceding them with a backslash () if they are to be treated as literals.
This parameter goes hand in hand with the
anchoring
parameter. If you’re creating a Rule that depends on a specific query, you must specify the pattern and anchoring. The empty""
pattern is only allowed whenanchoring
is set tois
.Otherwise, you can omit both.
- Facet value placeholder:
- alternatives Boolean
Whether the
pattern
matches on plurals, synonyms, and typos.This parameter goes hand in hand with the
pattern
parameter. If thepattern
is “shoe” andalternatives
istrue
, thepattern
matches on “shoes”, as well as synonyms and typos of “shoe”.- anchoring String
Whether the pattern parameter must match the beginning or the end of the query string, or both, or none. Possible values are
is
,startsWith
,endsWith
andcontains
. This parameter goes hand in hand with thepattern
parameter. If you’re creating a Rule that depends on a specific query, you must specify thepattern
andanchoring
.Otherwise, you can omit both.
- context String
- Rule context (format:
[A-Za-z0-9_-]+
). When specified, the Rule is only applied when the same context is specified at query time (using theruleContexts
parameter). When absent, the Rule is generic and always applies (provided that its other conditions are met, of course). - pattern String
Query pattern syntax. Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens, which can be either:
- Facet value placeholder:
{facet:$facet_name}
. Example:{facet:brand}
. - Literal: the world itself. Example: Algolia.
Special characters (
*
,{
,}
,:
and\
) must be escaped by preceding them with a backslash () if they are to be treated as literals.
This parameter goes hand in hand with the
anchoring
parameter. If you’re creating a Rule that depends on a specific query, you must specify the pattern and anchoring. The empty""
pattern is only allowed whenanchoring
is set tois
.Otherwise, you can omit both.
- Facet value placeholder:
RuleConsequence, RuleConsequenceArgs
- Hides List<string>
- List of object IDs to hide from hits.
- Params
Rule
Consequence Params - Deprecated: Use
params_json
instead. Additional search parameters. Any valid search parameter is allowed. Specific treatment is applied to these fields:query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - Params
Json string - Additional search parameters in JSON format. Any valid search parameter is allowed. Specific treatment is applied to these fields:
query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - Promotes
List<Rule
Consequence Promote> - Objects to promote as hits.
- User
Data string - Custom JSON formatted string that will be appended to the userData array in the response. This object is not interpreted by the API. It is limited to 1kB of minified JSON.
- Hides []string
- List of object IDs to hide from hits.
- Params
Rule
Consequence Params - Deprecated: Use
params_json
instead. Additional search parameters. Any valid search parameter is allowed. Specific treatment is applied to these fields:query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - Params
Json string - Additional search parameters in JSON format. Any valid search parameter is allowed. Specific treatment is applied to these fields:
query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - Promotes
[]Rule
Consequence Promote - Objects to promote as hits.
- User
Data string - Custom JSON formatted string that will be appended to the userData array in the response. This object is not interpreted by the API. It is limited to 1kB of minified JSON.
- hides List<String>
- List of object IDs to hide from hits.
- params
Rule
Consequence Params - Deprecated: Use
params_json
instead. Additional search parameters. Any valid search parameter is allowed. Specific treatment is applied to these fields:query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - params
Json String - Additional search parameters in JSON format. Any valid search parameter is allowed. Specific treatment is applied to these fields:
query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - promotes
List<Rule
Consequence Promote> - Objects to promote as hits.
- user
Data String - Custom JSON formatted string that will be appended to the userData array in the response. This object is not interpreted by the API. It is limited to 1kB of minified JSON.
- hides string[]
- List of object IDs to hide from hits.
- params
Rule
Consequence Params - Deprecated: Use
params_json
instead. Additional search parameters. Any valid search parameter is allowed. Specific treatment is applied to these fields:query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - params
Json string - Additional search parameters in JSON format. Any valid search parameter is allowed. Specific treatment is applied to these fields:
query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - promotes
Rule
Consequence Promote[] - Objects to promote as hits.
- user
Data string - Custom JSON formatted string that will be appended to the userData array in the response. This object is not interpreted by the API. It is limited to 1kB of minified JSON.
- hides Sequence[str]
- List of object IDs to hide from hits.
- params
Rule
Consequence Params - Deprecated: Use
params_json
instead. Additional search parameters. Any valid search parameter is allowed. Specific treatment is applied to these fields:query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - params_
json str - Additional search parameters in JSON format. Any valid search parameter is allowed. Specific treatment is applied to these fields:
query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - promotes
Sequence[Rule
Consequence Promote] - Objects to promote as hits.
- user_
data str - Custom JSON formatted string that will be appended to the userData array in the response. This object is not interpreted by the API. It is limited to 1kB of minified JSON.
- hides List<String>
- List of object IDs to hide from hits.
- params Property Map
- Deprecated: Use
params_json
instead. Additional search parameters. Any valid search parameter is allowed. Specific treatment is applied to these fields:query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - params
Json String - Additional search parameters in JSON format. Any valid search parameter is allowed. Specific treatment is applied to these fields:
query
,automaticFacetFilters
,automaticOptionalFacetFilters
. - promotes List<Property Map>
- Objects to promote as hits.
- user
Data String - Custom JSON formatted string that will be appended to the userData array in the response. This object is not interpreted by the API. It is limited to 1kB of minified JSON.
RuleConsequenceParams, RuleConsequenceParamsArgs
- Automatic
Facet List<RuleFilters Consequence Params Automatic Facet Filter> - Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
- Automatic
Optional List<RuleFacet Filters Consequence Params Automatic Optional Facet Filter> - Same syntax as
automatic_facet_filters
, but the engine treats the filters as optional. Behaves like optionalFilters. - Object
Queries List<RuleConsequence Params Object Query> - It describes incremental edits to be made to the query string. Either one of
query
orobject_query
can be set. - Query string
- It replaces the entire query string. Either one of
query
orobject_query
can be set.
- Automatic
Facet []RuleFilters Consequence Params Automatic Facet Filter - Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
- Automatic
Optional []RuleFacet Filters Consequence Params Automatic Optional Facet Filter - Same syntax as
automatic_facet_filters
, but the engine treats the filters as optional. Behaves like optionalFilters. - Object
Queries []RuleConsequence Params Object Query - It describes incremental edits to be made to the query string. Either one of
query
orobject_query
can be set. - Query string
- It replaces the entire query string. Either one of
query
orobject_query
can be set.
- automatic
Facet List<RuleFilters Consequence Params Automatic Facet Filter> - Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
- automatic
Optional List<RuleFacet Filters Consequence Params Automatic Optional Facet Filter> - Same syntax as
automatic_facet_filters
, but the engine treats the filters as optional. Behaves like optionalFilters. - object
Queries List<RuleConsequence Params Object Query> - It describes incremental edits to be made to the query string. Either one of
query
orobject_query
can be set. - query String
- It replaces the entire query string. Either one of
query
orobject_query
can be set.
- automatic
Facet RuleFilters Consequence Params Automatic Facet Filter[] - Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
- automatic
Optional RuleFacet Filters Consequence Params Automatic Optional Facet Filter[] - Same syntax as
automatic_facet_filters
, but the engine treats the filters as optional. Behaves like optionalFilters. - object
Queries RuleConsequence Params Object Query[] - It describes incremental edits to be made to the query string. Either one of
query
orobject_query
can be set. - query string
- It replaces the entire query string. Either one of
query
orobject_query
can be set.
- automatic_
facet_ Sequence[Rulefilters Consequence Params Automatic Facet Filter] - Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
- automatic_
optional_ Sequence[Rulefacet_ filters Consequence Params Automatic Optional Facet Filter] - Same syntax as
automatic_facet_filters
, but the engine treats the filters as optional. Behaves like optionalFilters. - object_
queries Sequence[RuleConsequence Params Object Query] - It describes incremental edits to be made to the query string. Either one of
query
orobject_query
can be set. - query str
- It replaces the entire query string. Either one of
query
orobject_query
can be set.
- automatic
Facet List<Property Map>Filters - Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
- automatic
Optional List<Property Map>Facet Filters - Same syntax as
automatic_facet_filters
, but the engine treats the filters as optional. Behaves like optionalFilters. - object
Queries List<Property Map> - It describes incremental edits to be made to the query string. Either one of
query
orobject_query
can be set. - query String
- It replaces the entire query string. Either one of
query
orobject_query
can be set.
RuleConsequenceParamsAutomaticFacetFilter, RuleConsequenceParamsAutomaticFacetFilterArgs
- Facet string
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- Disjunctive bool
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - Score double
- Score for the filter. Typically used for optional or disjunctive filters.
- Facet string
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- Disjunctive bool
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - Score float64
- Score for the filter. Typically used for optional or disjunctive filters.
- facet String
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive Boolean
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score Double
- Score for the filter. Typically used for optional or disjunctive filters.
- facet string
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive boolean
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score number
- Score for the filter. Typically used for optional or disjunctive filters.
- facet str
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive bool
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score float
- Score for the filter. Typically used for optional or disjunctive filters.
- facet String
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive Boolean
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score Number
- Score for the filter. Typically used for optional or disjunctive filters.
RuleConsequenceParamsAutomaticOptionalFacetFilter, RuleConsequenceParamsAutomaticOptionalFacetFilterArgs
- Facet string
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- Disjunctive bool
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - Score double
- Score for the filter. Typically used for optional or disjunctive filters.
- Facet string
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- Disjunctive bool
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - Score float64
- Score for the filter. Typically used for optional or disjunctive filters.
- facet String
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive Boolean
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score Double
- Score for the filter. Typically used for optional or disjunctive filters.
- facet string
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive boolean
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score number
- Score for the filter. Typically used for optional or disjunctive filters.
- facet str
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive bool
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score float
- Score for the filter. Typically used for optional or disjunctive filters.
- facet String
- Attribute to filter on. This must match a facet placeholder in the Rule’s pattern.
- disjunctive Boolean
- Whether the filter is disjunctive (true) or conjunctive (false). If the filter applies multiple times, e.g. because the query string contains multiple values of the same facet, the multiple occurrences are combined with an
AND
operator by default (conjunctive mode). If the filter is specified as disjunctive, however, multiple occurrences are combined with anOR
operator instead. - score Number
- Score for the filter. Typically used for optional or disjunctive filters.
RuleConsequenceParamsObjectQuery, RuleConsequenceParamsObjectQueryArgs
- Delete string
- Text or patterns to remove from the query string.
- Type string
- Type of edit. Must be one of:
-
remove
: when you want to delete some text and not replace it with anything -replace
: when you want to delete some text and replace it with something else - Insert string
- Text that should be inserted in place of the removed text inside the query string.
- Delete string
- Text or patterns to remove from the query string.
- Type string
- Type of edit. Must be one of:
-
remove
: when you want to delete some text and not replace it with anything -replace
: when you want to delete some text and replace it with something else - Insert string
- Text that should be inserted in place of the removed text inside the query string.
- delete String
- Text or patterns to remove from the query string.
- type String
- Type of edit. Must be one of:
-
remove
: when you want to delete some text and not replace it with anything -replace
: when you want to delete some text and replace it with something else - insert String
- Text that should be inserted in place of the removed text inside the query string.
- delete string
- Text or patterns to remove from the query string.
- type string
- Type of edit. Must be one of:
-
remove
: when you want to delete some text and not replace it with anything -replace
: when you want to delete some text and replace it with something else - insert string
- Text that should be inserted in place of the removed text inside the query string.
- delete str
- Text or patterns to remove from the query string.
- type str
- Type of edit. Must be one of:
-
remove
: when you want to delete some text and not replace it with anything -replace
: when you want to delete some text and replace it with something else - insert str
- Text that should be inserted in place of the removed text inside the query string.
- delete String
- Text or patterns to remove from the query string.
- type String
- Type of edit. Must be one of:
-
remove
: when you want to delete some text and not replace it with anything -replace
: when you want to delete some text and replace it with something else - insert String
- Text that should be inserted in place of the removed text inside the query string.
RuleConsequencePromote, RuleConsequencePromoteArgs
- object_
ids Sequence[str] - position float
- The position to promote the object(s) to (zero-based). If you pass
object_ids
, we place the objects at this position as a group. For example, if you pass fourobject_ids
to position0
, the objects take the first four positions.
RuleValidity, RuleValidityArgs
Import
$ pulumi import algolia:index/rule:Rule default {{index_name}}/{{object_id}}
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.