alicloud.ots.SearchIndex
Explore with Pulumi AI
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: pulumi.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: pulumi.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",
},
},
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.ots.Instance;
import com.pulumi.alicloud.ots.InstanceArgs;
import com.pulumi.alicloud.ots.Table;
import com.pulumi.alicloud.ots.TableArgs;
import com.pulumi.alicloud.ots.inputs.TablePrimaryKeyArgs;
import com.pulumi.alicloud.ots.SearchIndex;
import com.pulumi.alicloud.ots.SearchIndexArgs;
import com.pulumi.alicloud.ots.inputs.SearchIndexSchemaArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.name(String.format("%s-%s", name,default_.result()))
.description(name)
.accessedBy("Any")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.build());
var defaultTable = new Table("defaultTable", TableArgs.builder()
.instanceName(defaultInstance.name())
.tableName("tf_example")
.timeToLive(-1)
.maxVersion(1)
.enableSse(true)
.sseKeyType("SSE_KMS_SERVICE")
.primaryKeys(
TablePrimaryKeyArgs.builder()
.name("pk1")
.type("Integer")
.build(),
TablePrimaryKeyArgs.builder()
.name("pk2")
.type("String")
.build(),
TablePrimaryKeyArgs.builder()
.name("pk3")
.type("Binary")
.build())
.build());
var defaultSearchIndex = new SearchIndex("defaultSearchIndex", SearchIndexArgs.builder()
.instanceName(defaultInstance.name())
.tableName(defaultTable.tableName())
.indexName("example_index")
.timeToLive(-1)
.schemas(SearchIndexSchemaArgs.builder()
.fieldSchemas(
SearchIndexSchemaFieldSchemaArgs.builder()
.fieldName("col1")
.fieldType("Text")
.isArray(false)
.index(true)
.analyzer("Split")
.store(true)
.build(),
SearchIndexSchemaFieldSchemaArgs.builder()
.fieldName("col2")
.fieldType("Long")
.enableSortAndAgg(true)
.build(),
SearchIndexSchemaFieldSchemaArgs.builder()
.fieldName("pk1")
.fieldType("Long")
.build(),
SearchIndexSchemaFieldSchemaArgs.builder()
.fieldName("pk2")
.fieldType("Text")
.build())
.indexSettings(SearchIndexSchemaIndexSettingArgs.builder()
.routingFields(
"pk1",
"pk2")
.build())
.indexSorts(SearchIndexSchemaIndexSortArgs.builder()
.sorters(
SearchIndexSchemaIndexSortSorterArgs.builder()
.sorterType("PrimaryKeySort")
.order("Asc")
.build(),
SearchIndexSchemaIndexSortSorterArgs.builder()
.sorterType("FieldSort")
.order("Desc")
.fieldName("col2")
.mode("Max")
.build())
.build())
.build())
.build());
}
}
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=[{
"field_schemas": [{
"field_name": "string",
"field_type": "string",
"analyzer": "string",
"enable_sort_and_agg": False,
"index": False,
"is_array": False,
"store": False,
}],
"index_settings": [{
"routing_fields": ["string"],
}],
"index_sorts": [{
"sorters": [{
"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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The SearchIndex resource accepts the following input properties:
- Index
Name string - The index name of the OTS Table. If changed, a new index would be created.
- Instance
Name string - The name of the OTS instance in which table will located.
- Schemas
List<Pulumi.
Ali Cloud. Ots. Inputs. Search Index Schema> - The schema of the search index. If changed, a new index would be created. See
schema
below. - Table
Name string - The name of the OTS table. If changed, a new table would be created.
- Time
To intLive - 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 string - The index name of the OTS Table. If changed, a new index would be created.
- Instance
Name string - The name of the OTS instance in which table will located.
- Schemas
[]Search
Index Schema Args - The schema of the search index. If changed, a new index would be created. See
schema
below. - Table
Name string - The name of the OTS table. If changed, a new table would be created.
- Time
To intLive - 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 String - The index name of the OTS Table. If changed, a new index would be created.
- instance
Name String - The name of the OTS instance in which table will located.
- schemas
List<Search
Index Schema> - The schema of the search index. If changed, a new index would be created. See
schema
below. - table
Name String - The name of the OTS table. If changed, a new table would be created.
- time
To IntegerLive - 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 string - The index name of the OTS Table. If changed, a new index would be created.
- instance
Name string - The name of the OTS instance in which table will located.
- schemas
Search
Index Schema[] - The schema of the search index. If changed, a new index would be created. See
schema
below. - table
Name string - The name of the OTS table. If changed, a new table would be created.
- time
To numberLive - 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[Search
Index Schema Args] - 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_ intlive - 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 String - The index name of the OTS Table. If changed, a new index would be created.
- instance
Name 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. - table
Name String - The name of the OTS table. If changed, a new table would be created.
- time
To NumberLive - 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:
- Create
Time int - The search index create time.
- Current
Sync intTimestamp - The timestamp for sync phase.
- Id string
- The provider-assigned unique ID for this managed resource.
- Index
Id string - The index id of the search index which could not be changed.
- Sync
Phase string - The search index sync phase. possible values:
Full
,Incr
.
- Create
Time int - The search index create time.
- Current
Sync intTimestamp - The timestamp for sync phase.
- Id string
- The provider-assigned unique ID for this managed resource.
- Index
Id string - The index id of the search index which could not be changed.
- Sync
Phase string - The search index sync phase. possible values:
Full
,Incr
.
- create
Time Integer - The search index create time.
- current
Sync IntegerTimestamp - The timestamp for sync phase.
- id String
- The provider-assigned unique ID for this managed resource.
- index
Id String - The index id of the search index which could not be changed.
- sync
Phase String - The search index sync phase. possible values:
Full
,Incr
.
- create
Time number - The search index create time.
- current
Sync numberTimestamp - The timestamp for sync phase.
- id string
- The provider-assigned unique ID for this managed resource.
- index
Id string - The index id of the search index which could not be changed.
- sync
Phase string - The search index sync phase. possible values:
Full
,Incr
.
- create_
time int - The search index create time.
- current_
sync_ inttimestamp - 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
.
- create
Time Number - The search index create time.
- current
Sync NumberTimestamp - The timestamp for sync phase.
- id String
- The provider-assigned unique ID for this managed resource.
- index
Id String - The index id of the search index which could not be changed.
- sync
Phase 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.
- Create
Time int - The search index create time.
- Current
Sync intTimestamp - The timestamp for sync phase.
- Index
Id string - The index id of the search index which could not be changed.
- Index
Name string - The index name of the OTS Table. If changed, a new index would be created.
- Instance
Name string - The name of the OTS instance in which table will located.
- Schemas
List<Pulumi.
Ali Cloud. Ots. Inputs. Search Index Schema> - The schema of the search index. If changed, a new index would be created. See
schema
below. - Sync
Phase string - The search index sync phase. possible values:
Full
,Incr
. - Table
Name string - The name of the OTS table. If changed, a new table would be created.
- Time
To intLive - 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 intTimestamp - The timestamp for sync phase.
- Index
Id string - The index id of the search index which could not be changed.
- Index
Name string - The index name of the OTS Table. If changed, a new index would be created.
- Instance
Name string - The name of the OTS instance in which table will located.
- Schemas
[]Search
Index Schema Args - The schema of the search index. If changed, a new index would be created. See
schema
below. - Sync
Phase string - The search index sync phase. possible values:
Full
,Incr
. - Table
Name string - The name of the OTS table. If changed, a new table would be created.
- Time
To intLive - 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 Integer - The search index create time.
- current
Sync IntegerTimestamp - The timestamp for sync phase.
- index
Id String - The index id of the search index which could not be changed.
- index
Name String - The index name of the OTS Table. If changed, a new index would be created.
- instance
Name String - The name of the OTS instance in which table will located.
- schemas
List<Search
Index Schema> - The schema of the search index. If changed, a new index would be created. See
schema
below. - sync
Phase String - The search index sync phase. possible values:
Full
,Incr
. - table
Name String - The name of the OTS table. If changed, a new table would be created.
- time
To IntegerLive - 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 number - The search index create time.
- current
Sync numberTimestamp - The timestamp for sync phase.
- index
Id string - The index id of the search index which could not be changed.
- index
Name string - The index name of the OTS Table. If changed, a new index would be created.
- instance
Name string - The name of the OTS instance in which table will located.
- schemas
Search
Index Schema[] - The schema of the search index. If changed, a new index would be created. See
schema
below. - sync
Phase string - The search index sync phase. possible values:
Full
,Incr
. - table
Name string - The name of the OTS table. If changed, a new table would be created.
- time
To numberLive - 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_ inttimestamp - 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[Search
Index Schema Args] - 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_ intlive - 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 Number - The search index create time.
- current
Sync NumberTimestamp - The timestamp for sync phase.
- index
Id String - The index id of the search index which could not be changed.
- index
Name String - The index name of the OTS Table. If changed, a new index would be created.
- instance
Name 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. - sync
Phase String - The search index sync phase. possible values:
Full
,Incr
. - table
Name String - The name of the OTS table. If changed, a new table would be created.
- time
To NumberLive - 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
- Field
Schemas List<Pulumi.Ali Cloud. Ots. Inputs. Search Index Schema Field Schema> - A list of field schemas. See
field_schema
below. - Index
Settings List<Pulumi.Ali Cloud. Ots. Inputs. Search Index Schema Index Setting> - The settings of the search index, including routingFields. See
index_setting
below. - Index
Sorts List<Pulumi.Ali Cloud. Ots. Inputs. Search Index Schema Index Sort> - 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 []SearchIndex Schema Field Schema - A list of field schemas. See
field_schema
below. - Index
Settings []SearchIndex Schema Index Setting - The settings of the search index, including routingFields. See
index_setting
below. - Index
Sorts []SearchIndex Schema Index Sort - 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 List<SearchIndex Schema Field Schema> - A list of field schemas. See
field_schema
below. - index
Settings List<SearchIndex Schema Index Setting> - The settings of the search index, including routingFields. See
index_setting
below. - index
Sorts List<SearchIndex Schema Index Sort> - 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 SearchIndex Schema Field Schema[] - A list of field schemas. See
field_schema
below. - index
Settings SearchIndex Schema Index Setting[] - The settings of the search index, including routingFields. See
index_setting
below. - index
Sorts SearchIndex Schema Index Sort[] - 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[SearchIndex Schema Field Schema] - A list of field schemas. See
field_schema
below. - index_
settings Sequence[SearchIndex Schema Index Setting] - The settings of the search index, including routingFields. See
index_setting
below. - index_
sorts Sequence[SearchIndex Schema Index Sort] - 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 List<Property Map> - A list of field schemas. See
field_schema
below. - index
Settings List<Property Map> - The settings of the search index, including routingFields. See
index_setting
below. - index
Sorts 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
- Field
Name string - The name of the field that is used to sort data. only required if sorter_type is FieldSort.
- Field
Type 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.
- Enable
Sort boolAnd Agg - 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.
- Field
Name string - The name of the field that is used to sort data. only required if sorter_type is FieldSort.
- Field
Type 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.
- Enable
Sort boolAnd Agg - 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.
- field
Name String - The name of the field that is used to sort data. only required if sorter_type is FieldSort.
- field
Type 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.
- enable
Sort BooleanAnd Agg - 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.
- is
Array 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 string - The name of the field that is used to sort data. only required if sorter_type is FieldSort.
- field
Type 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.
- enable
Sort booleanAnd Agg - 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.
- is
Array 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_ booland_ agg - 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.
- field
Name String - The name of the field that is used to sort data. only required if sorter_type is FieldSort.
- field
Type 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.
- enable
Sort BooleanAnd Agg - 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.
- is
Array 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
- Routing
Fields 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.
- Routing
Fields []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 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.
- routing
Fields 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.
- routing
Fields 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.
Ali Cloud. Ots. Inputs. Search Index Schema Index Sort Sorter> - Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See
sorter
below.
- Sorters
[]Search
Index Schema Index Sort Sorter - Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See
sorter
below.
- sorters
List<Search
Index Schema Index Sort Sorter> - Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See
sorter
below.
- sorters
Search
Index Schema Index Sort Sorter[] - Specifies the presorting method for the search index. PrimaryKeySort and FieldSort are supported. See
sorter
below.
- sorters
Sequence[Search
Index Schema Index Sort Sorter] - 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
- Field
Name 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
. - Sorter
Type string - Data is sorted by Which fields or keys. valid values:
PrimaryKeySort
,FieldSort
.
- Field
Name 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
. - Sorter
Type string - Data is sorted by Which fields or keys. valid values:
PrimaryKeySort
,FieldSort
.
- field
Name 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
. - sorter
Type String - Data is sorted by Which fields or keys. valid values:
PrimaryKeySort
,FieldSort
.
- field
Name 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
. - sorter
Type 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
.
- field
Name 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
. - sorter
Type 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.