1. Packages
  2. Alicloud Provider
  3. API Docs
  4. ots
  5. SearchIndex
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.ots.SearchIndex

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides an OTS search index resource.

    For information about OTS search index and how to use it, see Search index overview.

    NOTE: Available since v1.187.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const _default = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const defaultInstance = new alicloud.ots.Instance("default", {
        name: `${name}-${_default.result}`,
        description: name,
        accessedBy: "Any",
        tags: {
            Created: "TF",
            For: "example",
        },
    });
    const defaultTable = new alicloud.ots.Table("default", {
        instanceName: defaultInstance.name,
        tableName: "tf_example",
        timeToLive: -1,
        maxVersion: 1,
        enableSse: true,
        sseKeyType: "SSE_KMS_SERVICE",
        primaryKeys: [
            {
                name: "pk1",
                type: "Integer",
            },
            {
                name: "pk2",
                type: "String",
            },
            {
                name: "pk3",
                type: "Binary",
            },
        ],
    });
    const defaultSearchIndex = new alicloud.ots.SearchIndex("default", {
        instanceName: defaultInstance.name,
        tableName: defaultTable.tableName,
        indexName: "example_index",
        timeToLive: -1,
        schemas: [{
            fieldSchemas: [
                {
                    fieldName: "col1",
                    fieldType: "Text",
                    isArray: false,
                    index: true,
                    analyzer: "Split",
                    store: true,
                },
                {
                    fieldName: "col2",
                    fieldType: "Long",
                    enableSortAndAgg: true,
                },
                {
                    fieldName: "pk1",
                    fieldType: "Long",
                },
                {
                    fieldName: "pk2",
                    fieldType: "Text",
                },
            ],
            indexSettings: [{
                routingFields: [
                    "pk1",
                    "pk2",
                ],
            }],
            indexSorts: [{
                sorters: [
                    {
                        sorterType: "PrimaryKeySort",
                        order: "Asc",
                    },
                    {
                        sorterType: "FieldSort",
                        order: "Desc",
                        fieldName: "col2",
                        mode: "Max",
                    },
                ],
            }],
        }],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = random.index.Integer("default",
        min=10000,
        max=99999)
    default_instance = alicloud.ots.Instance("default",
        name=f"{name}-{default['result']}",
        description=name,
        accessed_by="Any",
        tags={
            "Created": "TF",
            "For": "example",
        })
    default_table = alicloud.ots.Table("default",
        instance_name=default_instance.name,
        table_name="tf_example",
        time_to_live=-1,
        max_version=1,
        enable_sse=True,
        sse_key_type="SSE_KMS_SERVICE",
        primary_keys=[
            {
                "name": "pk1",
                "type": "Integer",
            },
            {
                "name": "pk2",
                "type": "String",
            },
            {
                "name": "pk3",
                "type": "Binary",
            },
        ])
    default_search_index = alicloud.ots.SearchIndex("default",
        instance_name=default_instance.name,
        table_name=default_table.table_name,
        index_name="example_index",
        time_to_live=-1,
        schemas=[{
            "field_schemas": [
                {
                    "field_name": "col1",
                    "field_type": "Text",
                    "is_array": False,
                    "index": True,
                    "analyzer": "Split",
                    "store": True,
                },
                {
                    "field_name": "col2",
                    "field_type": "Long",
                    "enable_sort_and_agg": True,
                },
                {
                    "field_name": "pk1",
                    "field_type": "Long",
                },
                {
                    "field_name": "pk2",
                    "field_type": "Text",
                },
            ],
            "index_settings": [{
                "routing_fields": [
                    "pk1",
                    "pk2",
                ],
            }],
            "index_sorts": [{
                "sorters": [
                    {
                        "sorter_type": "PrimaryKeySort",
                        "order": "Asc",
                    },
                    {
                        "sorter_type": "FieldSort",
                        "order": "Desc",
                        "field_name": "col2",
                        "mode": "Max",
                    },
                ],
            }],
        }])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		defaultInstance, err := ots.NewInstance(ctx, "default", &ots.InstanceArgs{
    			Name:        pulumi.Sprintf("%v-%v", name, _default.Result),
    			Description: pulumi.String(name),
    			AccessedBy:  pulumi.String("Any"),
    			Tags: pulumi.StringMap{
    				"Created": pulumi.String("TF"),
    				"For":     pulumi.String("example"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultTable, err := ots.NewTable(ctx, "default", &ots.TableArgs{
    			InstanceName: defaultInstance.Name,
    			TableName:    pulumi.String("tf_example"),
    			TimeToLive:   int(-1),
    			MaxVersion:   pulumi.Int(1),
    			EnableSse:    pulumi.Bool(true),
    			SseKeyType:   pulumi.String("SSE_KMS_SERVICE"),
    			PrimaryKeys: ots.TablePrimaryKeyArray{
    				&ots.TablePrimaryKeyArgs{
    					Name: pulumi.String("pk1"),
    					Type: pulumi.String("Integer"),
    				},
    				&ots.TablePrimaryKeyArgs{
    					Name: pulumi.String("pk2"),
    					Type: pulumi.String("String"),
    				},
    				&ots.TablePrimaryKeyArgs{
    					Name: pulumi.String("pk3"),
    					Type: pulumi.String("Binary"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ots.NewSearchIndex(ctx, "default", &ots.SearchIndexArgs{
    			InstanceName: defaultInstance.Name,
    			TableName:    defaultTable.TableName,
    			IndexName:    pulumi.String("example_index"),
    			TimeToLive:   int(-1),
    			Schemas: ots.SearchIndexSchemaArray{
    				&ots.SearchIndexSchemaArgs{
    					FieldSchemas: ots.SearchIndexSchemaFieldSchemaArray{
    						&ots.SearchIndexSchemaFieldSchemaArgs{
    							FieldName: pulumi.String("col1"),
    							FieldType: pulumi.String("Text"),
    							IsArray:   pulumi.Bool(false),
    							Index:     pulumi.Bool(true),
    							Analyzer:  pulumi.String("Split"),
    							Store:     pulumi.Bool(true),
    						},
    						&ots.SearchIndexSchemaFieldSchemaArgs{
    							FieldName:        pulumi.String("col2"),
    							FieldType:        pulumi.String("Long"),
    							EnableSortAndAgg: pulumi.Bool(true),
    						},
    						&ots.SearchIndexSchemaFieldSchemaArgs{
    							FieldName: pulumi.String("pk1"),
    							FieldType: pulumi.String("Long"),
    						},
    						&ots.SearchIndexSchemaFieldSchemaArgs{
    							FieldName: pulumi.String("pk2"),
    							FieldType: pulumi.String("Text"),
    						},
    					},
    					IndexSettings: ots.SearchIndexSchemaIndexSettingArray{
    						&ots.SearchIndexSchemaIndexSettingArgs{
    							RoutingFields: pulumi.StringArray{
    								pulumi.String("pk1"),
    								pulumi.String("pk2"),
    							},
    						},
    					},
    					IndexSorts: ots.SearchIndexSchemaIndexSortArray{
    						&ots.SearchIndexSchemaIndexSortArgs{
    							Sorters: ots.SearchIndexSchemaIndexSortSorterArray{
    								&ots.SearchIndexSchemaIndexSortSorterArgs{
    									SorterType: pulumi.String("PrimaryKeySort"),
    									Order:      pulumi.String("Asc"),
    								},
    								&ots.SearchIndexSchemaIndexSortSorterArgs{
    									SorterType: pulumi.String("FieldSort"),
    									Order:      pulumi.String("Desc"),
    									FieldName:  pulumi.String("col2"),
    									Mode:       pulumi.String("Max"),
    								},
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultInstance = new AliCloud.Ots.Instance("default", new()
        {
            Name = $"{name}-{@default.Result}",
            Description = name,
            AccessedBy = "Any",
            Tags = 
            {
                { "Created", "TF" },
                { "For", "example" },
            },
        });
    
        var defaultTable = new AliCloud.Ots.Table("default", new()
        {
            InstanceName = defaultInstance.Name,
            TableName = "tf_example",
            TimeToLive = -1,
            MaxVersion = 1,
            EnableSse = true,
            SseKeyType = "SSE_KMS_SERVICE",
            PrimaryKeys = new[]
            {
                new AliCloud.Ots.Inputs.TablePrimaryKeyArgs
                {
                    Name = "pk1",
                    Type = "Integer",
                },
                new AliCloud.Ots.Inputs.TablePrimaryKeyArgs
                {
                    Name = "pk2",
                    Type = "String",
                },
                new AliCloud.Ots.Inputs.TablePrimaryKeyArgs
                {
                    Name = "pk3",
                    Type = "Binary",
                },
            },
        });
    
        var defaultSearchIndex = new AliCloud.Ots.SearchIndex("default", new()
        {
            InstanceName = defaultInstance.Name,
            TableName = defaultTable.TableName,
            IndexName = "example_index",
            TimeToLive = -1,
            Schemas = new[]
            {
                new AliCloud.Ots.Inputs.SearchIndexSchemaArgs
                {
                    FieldSchemas = new[]
                    {
                        new AliCloud.Ots.Inputs.SearchIndexSchemaFieldSchemaArgs
                        {
                            FieldName = "col1",
                            FieldType = "Text",
                            IsArray = false,
                            Index = true,
                            Analyzer = "Split",
                            Store = true,
                        },
                        new AliCloud.Ots.Inputs.SearchIndexSchemaFieldSchemaArgs
                        {
                            FieldName = "col2",
                            FieldType = "Long",
                            EnableSortAndAgg = true,
                        },
                        new AliCloud.Ots.Inputs.SearchIndexSchemaFieldSchemaArgs
                        {
                            FieldName = "pk1",
                            FieldType = "Long",
                        },
                        new AliCloud.Ots.Inputs.SearchIndexSchemaFieldSchemaArgs
                        {
                            FieldName = "pk2",
                            FieldType = "Text",
                        },
                    },
                    IndexSettings = new[]
                    {
                        new AliCloud.Ots.Inputs.SearchIndexSchemaIndexSettingArgs
                        {
                            RoutingFields = new[]
                            {
                                "pk1",
                                "pk2",
                            },
                        },
                    },
                    IndexSorts = new[]
                    {
                        new AliCloud.Ots.Inputs.SearchIndexSchemaIndexSortArgs
                        {
                            Sorters = new[]
                            {
                                new AliCloud.Ots.Inputs.SearchIndexSchemaIndexSortSorterArgs
                                {
                                    SorterType = "PrimaryKeySort",
                                    Order = "Asc",
                                },
                                new AliCloud.Ots.Inputs.SearchIndexSchemaIndexSortSorterArgs
                                {
                                    SorterType = "FieldSort",
                                    Order = "Desc",
                                    FieldName = "col2",
                                    Mode = "Max",
                                },
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    Coming soon!
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      default:
        type: random:integer
        properties:
          min: 10000
          max: 99999
      defaultInstance:
        type: alicloud:ots:Instance
        name: default
        properties:
          name: ${name}-${default.result}
          description: ${name}
          accessedBy: Any
          tags:
            Created: TF
            For: example
      defaultTable:
        type: alicloud:ots:Table
        name: default
        properties:
          instanceName: ${defaultInstance.name}
          tableName: tf_example
          timeToLive: -1
          maxVersion: 1
          enableSse: true
          sseKeyType: SSE_KMS_SERVICE
          primaryKeys:
            - name: pk1
              type: Integer
            - name: pk2
              type: String
            - name: pk3
              type: Binary
      defaultSearchIndex:
        type: alicloud:ots:SearchIndex
        name: default
        properties:
          instanceName: ${defaultInstance.name}
          tableName: ${defaultTable.tableName}
          indexName: example_index
          timeToLive: -1
          schemas:
            - fieldSchemas:
                - fieldName: col1
                  fieldType: Text
                  isArray: false
                  index: true
                  analyzer: Split
                  store: true
                - fieldName: col2
                  fieldType: Long
                  enableSortAndAgg: true
                - fieldName: pk1
                  fieldType: Long
                - fieldName: pk2
                  fieldType: Text
              indexSettings:
                - routingFields:
                    - pk1
                    - pk2
              indexSorts:
                - sorters:
                    - sorterType: PrimaryKeySort
                      order: Asc
                    - sorterType: FieldSort
                      order: Desc
                      fieldName: col2
                      mode: Max
    

    Create SearchIndex Resource

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

    Constructor syntax

    new SearchIndex(name: string, args: SearchIndexArgs, opts?: CustomResourceOptions);
    @overload
    def SearchIndex(resource_name: str,
                    args: SearchIndexArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def SearchIndex(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    index_name: Optional[str] = None,
                    instance_name: Optional[str] = None,
                    schemas: Optional[Sequence[SearchIndexSchemaArgs]] = None,
                    table_name: Optional[str] = None,
                    time_to_live: Optional[int] = None)
    func NewSearchIndex(ctx *Context, name string, args SearchIndexArgs, opts ...ResourceOption) (*SearchIndex, error)
    public SearchIndex(string name, SearchIndexArgs args, CustomResourceOptions? opts = null)
    public SearchIndex(String name, SearchIndexArgs args)
    public SearchIndex(String name, SearchIndexArgs args, CustomResourceOptions options)
    
    type: alicloud:ots:SearchIndex
    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 SearchIndexArgs
    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 SearchIndexArgs
    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 SearchIndexArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SearchIndexArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SearchIndexArgs
    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 searchIndexResource = new AliCloud.Ots.SearchIndex("searchIndexResource", new()
    {
        IndexName = "string",
        InstanceName = "string",
        Schemas = new[]
        {
            new AliCloud.Ots.Inputs.SearchIndexSchemaArgs
            {
                FieldSchemas = new[]
                {
                    new AliCloud.Ots.Inputs.SearchIndexSchemaFieldSchemaArgs
                    {
                        FieldName = "string",
                        FieldType = "string",
                        Analyzer = "string",
                        EnableSortAndAgg = false,
                        Index = false,
                        IsArray = false,
                        Store = false,
                    },
                },
                IndexSettings = new[]
                {
                    new AliCloud.Ots.Inputs.SearchIndexSchemaIndexSettingArgs
                    {
                        RoutingFields = new[]
                        {
                            "string",
                        },
                    },
                },
                IndexSorts = new[]
                {
                    new AliCloud.Ots.Inputs.SearchIndexSchemaIndexSortArgs
                    {
                        Sorters = new[]
                        {
                            new AliCloud.Ots.Inputs.SearchIndexSchemaIndexSortSorterArgs
                            {
                                FieldName = "string",
                                Mode = "string",
                                Order = "string",
                                SorterType = "string",
                            },
                        },
                    },
                },
            },
        },
        TableName = "string",
        TimeToLive = 0,
    });
    
    example, err := ots.NewSearchIndex(ctx, "searchIndexResource", &ots.SearchIndexArgs{
    	IndexName:    pulumi.String("string"),
    	InstanceName: pulumi.String("string"),
    	Schemas: ots.SearchIndexSchemaArray{
    		&ots.SearchIndexSchemaArgs{
    			FieldSchemas: ots.SearchIndexSchemaFieldSchemaArray{
    				&ots.SearchIndexSchemaFieldSchemaArgs{
    					FieldName:        pulumi.String("string"),
    					FieldType:        pulumi.String("string"),
    					Analyzer:         pulumi.String("string"),
    					EnableSortAndAgg: pulumi.Bool(false),
    					Index:            pulumi.Bool(false),
    					IsArray:          pulumi.Bool(false),
    					Store:            pulumi.Bool(false),
    				},
    			},
    			IndexSettings: ots.SearchIndexSchemaIndexSettingArray{
    				&ots.SearchIndexSchemaIndexSettingArgs{
    					RoutingFields: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    			},
    			IndexSorts: ots.SearchIndexSchemaIndexSortArray{
    				&ots.SearchIndexSchemaIndexSortArgs{
    					Sorters: ots.SearchIndexSchemaIndexSortSorterArray{
    						&ots.SearchIndexSchemaIndexSortSorterArgs{
    							FieldName:  pulumi.String("string"),
    							Mode:       pulumi.String("string"),
    							Order:      pulumi.String("string"),
    							SorterType: pulumi.String("string"),
    						},
    					},
    				},
    			},
    		},
    	},
    	TableName:  pulumi.String("string"),
    	TimeToLive: pulumi.Int(0),
    })
    
    var searchIndexResource = new SearchIndex("searchIndexResource", SearchIndexArgs.builder()
        .indexName("string")
        .instanceName("string")
        .schemas(SearchIndexSchemaArgs.builder()
            .fieldSchemas(SearchIndexSchemaFieldSchemaArgs.builder()
                .fieldName("string")
                .fieldType("string")
                .analyzer("string")
                .enableSortAndAgg(false)
                .index(false)
                .isArray(false)
                .store(false)
                .build())
            .indexSettings(SearchIndexSchemaIndexSettingArgs.builder()
                .routingFields("string")
                .build())
            .indexSorts(SearchIndexSchemaIndexSortArgs.builder()
                .sorters(SearchIndexSchemaIndexSortSorterArgs.builder()
                    .fieldName("string")
                    .mode("string")
                    .order("string")
                    .sorterType("string")
                    .build())
                .build())
            .build())
        .tableName("string")
        .timeToLive(0)
        .build());
    
    search_index_resource = alicloud.ots.SearchIndex("searchIndexResource",
        index_name="string",
        instance_name="string",
        schemas=[alicloud.ots.SearchIndexSchemaArgs(
            field_schemas=[alicloud.ots.SearchIndexSchemaFieldSchemaArgs(
                field_name="string",
                field_type="string",
                analyzer="string",
                enable_sort_and_agg=False,
                index=False,
                is_array=False,
                store=False,
            )],
            index_settings=[alicloud.ots.SearchIndexSchemaIndexSettingArgs(
                routing_fields=["string"],
            )],
            index_sorts=[alicloud.ots.SearchIndexSchemaIndexSortArgs(
                sorters=[alicloud.ots.SearchIndexSchemaIndexSortSorterArgs(
                    field_name="string",
                    mode="string",
                    order="string",
                    sorter_type="string",
                )],
            )],
        )],
        table_name="string",
        time_to_live=0)
    
    const searchIndexResource = new alicloud.ots.SearchIndex("searchIndexResource", {
        indexName: "string",
        instanceName: "string",
        schemas: [{
            fieldSchemas: [{
                fieldName: "string",
                fieldType: "string",
                analyzer: "string",
                enableSortAndAgg: false,
                index: false,
                isArray: false,
                store: false,
            }],
            indexSettings: [{
                routingFields: ["string"],
            }],
            indexSorts: [{
                sorters: [{
                    fieldName: "string",
                    mode: "string",
                    order: "string",
                    sorterType: "string",
                }],
            }],
        }],
        tableName: "string",
        timeToLive: 0,
    });
    
    type: alicloud:ots:SearchIndex
    properties:
        indexName: string
        instanceName: string
        schemas:
            - fieldSchemas:
                - analyzer: string
                  enableSortAndAgg: false
                  fieldName: string
                  fieldType: string
                  index: false
                  isArray: false
                  store: false
              indexSettings:
                - routingFields:
                    - string
              indexSorts:
                - sorters:
                    - fieldName: string
                      mode: string
                      order: string
                      sorterType: string
        tableName: string
        timeToLive: 0
    

    SearchIndex Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The SearchIndex resource accepts the following input properties:

    IndexName string
    The index name of the OTS Table. If changed, a new index would be created.
    InstanceName string
    The name of the OTS instance in which table will located.
    Schemas List<Pulumi.AliCloud.Ots.Inputs.SearchIndexSchema>
    The schema of the search index. If changed, a new index would be created. See schema below.
    TableName string
    The name of the OTS table. If changed, a new table would be created.
    TimeToLive int
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    IndexName string
    The index name of the OTS Table. If changed, a new index would be created.
    InstanceName string
    The name of the OTS instance in which table will located.
    Schemas []SearchIndexSchemaArgs
    The schema of the search index. If changed, a new index would be created. See schema below.
    TableName string
    The name of the OTS table. If changed, a new table would be created.
    TimeToLive int
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    indexName String
    The index name of the OTS Table. If changed, a new index would be created.
    instanceName String
    The name of the OTS instance in which table will located.
    schemas List<SearchIndexSchema>
    The schema of the search index. If changed, a new index would be created. See schema below.
    tableName String
    The name of the OTS table. If changed, a new table would be created.
    timeToLive Integer
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    indexName string
    The index name of the OTS Table. If changed, a new index would be created.
    instanceName string
    The name of the OTS instance in which table will located.
    schemas SearchIndexSchema[]
    The schema of the search index. If changed, a new index would be created. See schema below.
    tableName string
    The name of the OTS table. If changed, a new table would be created.
    timeToLive number
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    index_name str
    The index name of the OTS Table. If changed, a new index would be created.
    instance_name str
    The name of the OTS instance in which table will located.
    schemas Sequence[SearchIndexSchemaArgs]
    The schema of the search index. If changed, a new index would be created. See schema below.
    table_name str
    The name of the OTS table. If changed, a new table would be created.
    time_to_live int
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    indexName String
    The index name of the OTS Table. If changed, a new index would be created.
    instanceName String
    The name of the OTS instance in which table will located.
    schemas List<Property Map>
    The schema of the search index. If changed, a new index would be created. See schema below.
    tableName String
    The name of the OTS table. If changed, a new table would be created.
    timeToLive Number
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SearchIndex resource produces the following output properties:

    CreateTime int
    The search index create time.
    CurrentSyncTimestamp int
    The timestamp for sync phase.
    Id string
    The provider-assigned unique ID for this managed resource.
    IndexId string
    The index id of the search index which could not be changed.
    SyncPhase string
    The search index sync phase. possible values: Full, Incr.
    CreateTime int
    The search index create time.
    CurrentSyncTimestamp int
    The timestamp for sync phase.
    Id string
    The provider-assigned unique ID for this managed resource.
    IndexId string
    The index id of the search index which could not be changed.
    SyncPhase string
    The search index sync phase. possible values: Full, Incr.
    createTime Integer
    The search index create time.
    currentSyncTimestamp Integer
    The timestamp for sync phase.
    id String
    The provider-assigned unique ID for this managed resource.
    indexId String
    The index id of the search index which could not be changed.
    syncPhase String
    The search index sync phase. possible values: Full, Incr.
    createTime number
    The search index create time.
    currentSyncTimestamp number
    The timestamp for sync phase.
    id string
    The provider-assigned unique ID for this managed resource.
    indexId string
    The index id of the search index which could not be changed.
    syncPhase string
    The search index sync phase. possible values: Full, Incr.
    create_time int
    The search index create time.
    current_sync_timestamp int
    The timestamp for sync phase.
    id str
    The provider-assigned unique ID for this managed resource.
    index_id str
    The index id of the search index which could not be changed.
    sync_phase str
    The search index sync phase. possible values: Full, Incr.
    createTime Number
    The search index create time.
    currentSyncTimestamp Number
    The timestamp for sync phase.
    id String
    The provider-assigned unique ID for this managed resource.
    indexId String
    The index id of the search index which could not be changed.
    syncPhase String
    The search index sync phase. possible values: Full, Incr.

    Look up Existing SearchIndex Resource

    Get an existing SearchIndex 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?: SearchIndexState, opts?: CustomResourceOptions): SearchIndex
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[int] = None,
            current_sync_timestamp: Optional[int] = None,
            index_id: Optional[str] = None,
            index_name: Optional[str] = None,
            instance_name: Optional[str] = None,
            schemas: Optional[Sequence[SearchIndexSchemaArgs]] = None,
            sync_phase: Optional[str] = None,
            table_name: Optional[str] = None,
            time_to_live: Optional[int] = None) -> SearchIndex
    func GetSearchIndex(ctx *Context, name string, id IDInput, state *SearchIndexState, opts ...ResourceOption) (*SearchIndex, error)
    public static SearchIndex Get(string name, Input<string> id, SearchIndexState? state, CustomResourceOptions? opts = null)
    public static SearchIndex get(String name, Output<String> id, SearchIndexState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    CreateTime int
    The search index create time.
    CurrentSyncTimestamp int
    The timestamp for sync phase.
    IndexId string
    The index id of the search index which could not be changed.
    IndexName string
    The index name of the OTS Table. If changed, a new index would be created.
    InstanceName string
    The name of the OTS instance in which table will located.
    Schemas List<Pulumi.AliCloud.Ots.Inputs.SearchIndexSchema>
    The schema of the search index. If changed, a new index would be created. See schema below.
    SyncPhase string
    The search index sync phase. possible values: Full, Incr.
    TableName string
    The name of the OTS table. If changed, a new table would be created.
    TimeToLive int
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    CreateTime int
    The search index create time.
    CurrentSyncTimestamp int
    The timestamp for sync phase.
    IndexId string
    The index id of the search index which could not be changed.
    IndexName string
    The index name of the OTS Table. If changed, a new index would be created.
    InstanceName string
    The name of the OTS instance in which table will located.
    Schemas []SearchIndexSchemaArgs
    The schema of the search index. If changed, a new index would be created. See schema below.
    SyncPhase string
    The search index sync phase. possible values: Full, Incr.
    TableName string
    The name of the OTS table. If changed, a new table would be created.
    TimeToLive int
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    createTime Integer
    The search index create time.
    currentSyncTimestamp Integer
    The timestamp for sync phase.
    indexId String
    The index id of the search index which could not be changed.
    indexName String
    The index name of the OTS Table. If changed, a new index would be created.
    instanceName String
    The name of the OTS instance in which table will located.
    schemas List<SearchIndexSchema>
    The schema of the search index. If changed, a new index would be created. See schema below.
    syncPhase String
    The search index sync phase. possible values: Full, Incr.
    tableName String
    The name of the OTS table. If changed, a new table would be created.
    timeToLive Integer
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    createTime number
    The search index create time.
    currentSyncTimestamp number
    The timestamp for sync phase.
    indexId string
    The index id of the search index which could not be changed.
    indexName string
    The index name of the OTS Table. If changed, a new index would be created.
    instanceName string
    The name of the OTS instance in which table will located.
    schemas SearchIndexSchema[]
    The schema of the search index. If changed, a new index would be created. See schema below.
    syncPhase string
    The search index sync phase. possible values: Full, Incr.
    tableName string
    The name of the OTS table. If changed, a new table would be created.
    timeToLive number
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    create_time int
    The search index create time.
    current_sync_timestamp int
    The timestamp for sync phase.
    index_id str
    The index id of the search index which could not be changed.
    index_name str
    The index name of the OTS Table. If changed, a new index would be created.
    instance_name str
    The name of the OTS instance in which table will located.
    schemas Sequence[SearchIndexSchemaArgs]
    The schema of the search index. If changed, a new index would be created. See schema below.
    sync_phase str
    The search index sync phase. possible values: Full, Incr.
    table_name str
    The name of the OTS table. If changed, a new table would be created.
    time_to_live int
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.
    createTime Number
    The search index create time.
    currentSyncTimestamp Number
    The timestamp for sync phase.
    indexId String
    The index id of the search index which could not be changed.
    indexName String
    The index name of the OTS Table. If changed, a new index would be created.
    instanceName String
    The name of the OTS instance in which table will located.
    schemas List<Property Map>
    The schema of the search index. If changed, a new index would be created. See schema below.
    syncPhase String
    The search index sync phase. possible values: Full, Incr.
    tableName String
    The name of the OTS table. If changed, a new table would be created.
    timeToLive Number
    The index type of the OTS Table. Specifies the retention period of data in the search index. Unit: seconds. Default value: -1. If the retention period exceeds the TTL value, OTS automatically deletes expired data.

    Supporting Types

    SearchIndexSchema, SearchIndexSchemaArgs

    FieldSchemas List<Pulumi.AliCloud.Ots.Inputs.SearchIndexSchemaFieldSchema>
    A list of field schemas. See field_schema below.
    IndexSettings List<Pulumi.AliCloud.Ots.Inputs.SearchIndexSchemaIndexSetting>
    The settings of the search index, including routingFields. See index_setting below.
    IndexSorts List<Pulumi.AliCloud.Ots.Inputs.SearchIndexSchemaIndexSort>
    The presorting settings of the search index, including sorters. If no value is specified for the indexSort parameter, field values are sorted by primary key by default. See index_sort below.
    FieldSchemas []SearchIndexSchemaFieldSchema
    A list of field schemas. See field_schema below.
    IndexSettings []SearchIndexSchemaIndexSetting
    The settings of the search index, including routingFields. See index_setting below.
    IndexSorts []SearchIndexSchemaIndexSort
    The presorting settings of the search index, including sorters. If no value is specified for the indexSort parameter, field values are sorted by primary key by default. See index_sort below.
    fieldSchemas List<SearchIndexSchemaFieldSchema>
    A list of field schemas. See field_schema below.
    indexSettings List<SearchIndexSchemaIndexSetting>
    The settings of the search index, including routingFields. See index_setting below.
    indexSorts List<SearchIndexSchemaIndexSort>
    The presorting settings of the search index, including sorters. If no value is specified for the indexSort parameter, field values are sorted by primary key by default. See index_sort below.
    fieldSchemas SearchIndexSchemaFieldSchema[]
    A list of field schemas. See field_schema below.
    indexSettings SearchIndexSchemaIndexSetting[]
    The settings of the search index, including routingFields. See index_setting below.
    indexSorts SearchIndexSchemaIndexSort[]
    The presorting settings of the search index, including sorters. If no value is specified for the indexSort parameter, field values are sorted by primary key by default. See index_sort below.
    field_schemas Sequence[SearchIndexSchemaFieldSchema]
    A list of field schemas. See field_schema below.
    index_settings Sequence[SearchIndexSchemaIndexSetting]
    The settings of the search index, including routingFields. See index_setting below.
    index_sorts Sequence[SearchIndexSchemaIndexSort]
    The presorting settings of the search index, including sorters. If no value is specified for the indexSort parameter, field values are sorted by primary key by default. See index_sort below.
    fieldSchemas List<Property Map>
    A list of field schemas. See field_schema below.
    indexSettings List<Property Map>
    The settings of the search index, including routingFields. See index_setting below.
    indexSorts List<Property Map>
    The presorting settings of the search index, including sorters. If no value is specified for the indexSort parameter, field values are sorted by primary key by default. See index_sort below.

    SearchIndexSchemaFieldSchema, SearchIndexSchemaFieldSchemaArgs

    FieldName string
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    FieldType string
    Specifies the type of the field. Use FieldType.XXX to set the type.
    Analyzer string
    Specifies the type of the analyzer that you want to use. If fieldType is set to Text, you can configure this parameter. Otherwise, the default analyzer type single-word tokenization is used.
    EnableSortAndAgg bool
    Specifies whether to enable sorting and aggregation. Type: Boolean. Sorting can be enabled only for fields for which enable_sort_and_agg is set to true.
    Index bool
    Specifies whether to enable indexing for the column. Type: Boolean.
    IsArray bool
    Specifies whether the value is an array. Type: Boolean.
    Store bool
    Specifies whether to store the value of the field in the search index. Type: Boolean. If you set store to true, you can read the value of the field from the search index without querying the data table. This improves query performance.
    FieldName string
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    FieldType string
    Specifies the type of the field. Use FieldType.XXX to set the type.
    Analyzer string
    Specifies the type of the analyzer that you want to use. If fieldType is set to Text, you can configure this parameter. Otherwise, the default analyzer type single-word tokenization is used.
    EnableSortAndAgg bool
    Specifies whether to enable sorting and aggregation. Type: Boolean. Sorting can be enabled only for fields for which enable_sort_and_agg is set to true.
    Index bool
    Specifies whether to enable indexing for the column. Type: Boolean.
    IsArray bool
    Specifies whether the value is an array. Type: Boolean.
    Store bool
    Specifies whether to store the value of the field in the search index. Type: Boolean. If you set store to true, you can read the value of the field from the search index without querying the data table. This improves query performance.
    fieldName String
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    fieldType String
    Specifies the type of the field. Use FieldType.XXX to set the type.
    analyzer String
    Specifies the type of the analyzer that you want to use. If fieldType is set to Text, you can configure this parameter. Otherwise, the default analyzer type single-word tokenization is used.
    enableSortAndAgg Boolean
    Specifies whether to enable sorting and aggregation. Type: Boolean. Sorting can be enabled only for fields for which enable_sort_and_agg is set to true.
    index Boolean
    Specifies whether to enable indexing for the column. Type: Boolean.
    isArray Boolean
    Specifies whether the value is an array. Type: Boolean.
    store Boolean
    Specifies whether to store the value of the field in the search index. Type: Boolean. If you set store to true, you can read the value of the field from the search index without querying the data table. This improves query performance.
    fieldName string
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    fieldType string
    Specifies the type of the field. Use FieldType.XXX to set the type.
    analyzer string
    Specifies the type of the analyzer that you want to use. If fieldType is set to Text, you can configure this parameter. Otherwise, the default analyzer type single-word tokenization is used.
    enableSortAndAgg boolean
    Specifies whether to enable sorting and aggregation. Type: Boolean. Sorting can be enabled only for fields for which enable_sort_and_agg is set to true.
    index boolean
    Specifies whether to enable indexing for the column. Type: Boolean.
    isArray boolean
    Specifies whether the value is an array. Type: Boolean.
    store boolean
    Specifies whether to store the value of the field in the search index. Type: Boolean. If you set store to true, you can read the value of the field from the search index without querying the data table. This improves query performance.
    field_name str
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    field_type str
    Specifies the type of the field. Use FieldType.XXX to set the type.
    analyzer str
    Specifies the type of the analyzer that you want to use. If fieldType is set to Text, you can configure this parameter. Otherwise, the default analyzer type single-word tokenization is used.
    enable_sort_and_agg bool
    Specifies whether to enable sorting and aggregation. Type: Boolean. Sorting can be enabled only for fields for which enable_sort_and_agg is set to true.
    index bool
    Specifies whether to enable indexing for the column. Type: Boolean.
    is_array bool
    Specifies whether the value is an array. Type: Boolean.
    store bool
    Specifies whether to store the value of the field in the search index. Type: Boolean. If you set store to true, you can read the value of the field from the search index without querying the data table. This improves query performance.
    fieldName String
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    fieldType String
    Specifies the type of the field. Use FieldType.XXX to set the type.
    analyzer String
    Specifies the type of the analyzer that you want to use. If fieldType is set to Text, you can configure this parameter. Otherwise, the default analyzer type single-word tokenization is used.
    enableSortAndAgg Boolean
    Specifies whether to enable sorting and aggregation. Type: Boolean. Sorting can be enabled only for fields for which enable_sort_and_agg is set to true.
    index Boolean
    Specifies whether to enable indexing for the column. Type: Boolean.
    isArray Boolean
    Specifies whether the value is an array. Type: Boolean.
    store Boolean
    Specifies whether to store the value of the field in the search index. Type: Boolean. If you set store to true, you can read the value of the field from the search index without querying the data table. This improves query performance.

    SearchIndexSchemaIndexSetting, SearchIndexSchemaIndexSettingArgs

    RoutingFields List<string>
    Specifies custom routing fields. You can specify some primary key columns as routing fields. Tablestore distributes data that is written to a search index across different partitions based on the specified routing fields. The data whose routing field values are the same is distributed to the same partition.
    RoutingFields []string
    Specifies custom routing fields. You can specify some primary key columns as routing fields. Tablestore distributes data that is written to a search index across different partitions based on the specified routing fields. The data whose routing field values are the same is distributed to the same partition.
    routingFields List<String>
    Specifies custom routing fields. You can specify some primary key columns as routing fields. Tablestore distributes data that is written to a search index across different partitions based on the specified routing fields. The data whose routing field values are the same is distributed to the same partition.
    routingFields string[]
    Specifies custom routing fields. You can specify some primary key columns as routing fields. Tablestore distributes data that is written to a search index across different partitions based on the specified routing fields. The data whose routing field values are the same is distributed to the same partition.
    routing_fields Sequence[str]
    Specifies custom routing fields. You can specify some primary key columns as routing fields. Tablestore distributes data that is written to a search index across different partitions based on the specified routing fields. The data whose routing field values are the same is distributed to the same partition.
    routingFields List<String>
    Specifies custom routing fields. You can specify some primary key columns as routing fields. Tablestore distributes data that is written to a search index across different partitions based on the specified routing fields. The data whose routing field values are the same is distributed to the same partition.

    SearchIndexSchemaIndexSort, SearchIndexSchemaIndexSortArgs

    Sorters List<Pulumi.AliCloud.Ots.Inputs.SearchIndexSchemaIndexSortSorter>
    Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See sorter below.
    Sorters []SearchIndexSchemaIndexSortSorter
    Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See sorter below.
    sorters List<SearchIndexSchemaIndexSortSorter>
    Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See sorter below.
    sorters SearchIndexSchemaIndexSortSorter[]
    Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See sorter below.
    sorters Sequence[SearchIndexSchemaIndexSortSorter]
    Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See sorter below.
    sorters List<Property Map>
    Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See sorter below.

    SearchIndexSchemaIndexSortSorter, SearchIndexSchemaIndexSortSorterArgs

    FieldName string
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    Mode string
    The sorting method that is used when the field contains multiple values. valid values: Min, Max, Avg. only required if sorter_type is FieldSort.
    Order string
    The sort order. Data can be sorted in ascending(Asc) or descending(Desc) order. Default value: Asc.
    SorterType string
    Data is sorted by Which fields or keys. valid values: PrimaryKeySort, FieldSort.
    FieldName string
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    Mode string
    The sorting method that is used when the field contains multiple values. valid values: Min, Max, Avg. only required if sorter_type is FieldSort.
    Order string
    The sort order. Data can be sorted in ascending(Asc) or descending(Desc) order. Default value: Asc.
    SorterType string
    Data is sorted by Which fields or keys. valid values: PrimaryKeySort, FieldSort.
    fieldName String
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    mode String
    The sorting method that is used when the field contains multiple values. valid values: Min, Max, Avg. only required if sorter_type is FieldSort.
    order String
    The sort order. Data can be sorted in ascending(Asc) or descending(Desc) order. Default value: Asc.
    sorterType String
    Data is sorted by Which fields or keys. valid values: PrimaryKeySort, FieldSort.
    fieldName string
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    mode string
    The sorting method that is used when the field contains multiple values. valid values: Min, Max, Avg. only required if sorter_type is FieldSort.
    order string
    The sort order. Data can be sorted in ascending(Asc) or descending(Desc) order. Default value: Asc.
    sorterType string
    Data is sorted by Which fields or keys. valid values: PrimaryKeySort, FieldSort.
    field_name str
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    mode str
    The sorting method that is used when the field contains multiple values. valid values: Min, Max, Avg. only required if sorter_type is FieldSort.
    order str
    The sort order. Data can be sorted in ascending(Asc) or descending(Desc) order. Default value: Asc.
    sorter_type str
    Data is sorted by Which fields or keys. valid values: PrimaryKeySort, FieldSort.
    fieldName String
    The name of the field that is used to sort data. only required if sorter_type is FieldSort.
    mode String
    The sorting method that is used when the field contains multiple values. valid values: Min, Max, Avg. only required if sorter_type is FieldSort.
    order String
    The sort order. Data can be sorted in ascending(Asc) or descending(Desc) order. Default value: Asc.
    sorterType String
    Data is sorted by Which fields or keys. valid values: PrimaryKeySort, FieldSort.

    Import

    OTS search index can be imported using id, e.g.

    $ pulumi import alicloud:ots/searchIndex:SearchIndex index1 <instance_name>:<table_name>:<index_name>:<index_type>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi