All Products
Search
Document Center

Tablestore:Kueri deskripsi indeks pencarian

Last Updated:Sep 19, 2026

Setelah membuat indeks pencarian, Anda dapat mengkueri deskripsinya, seperti informasi bidang dan pengaturan presorting.

Operasi API

Anda dapat memanggil operasi DescribeSearchIndex untuk mengkueri deskripsi indeks pencarian.

Parameter

Parameter

Deskripsi

tableName

Nama tabel data.

indexName

Nama indeks pencarian.

Metode

Anda dapat menggunakan Konsol Tablestore, CLI Tablestore, atau SDK Tablestore untuk mengkueri deskripsi indeks pencarian.

Sebelum mengkueri deskripsi indeks pencarian, pastikan persiapan berikut telah dilakukan:

Gunakan Konsol Tablestore

Anda dapat mengkueri deskripsi indeks pencarian di Konsol Tablestore, seperti informasi dasar, informasi metering, routing key, bidang indeks, dan pengaturan presorting.

  1. Buka tab Index Management.

    1. Masuk ke Konsol Tablestore.

    2. Pada bilah navigasi atas, pilih kelompok sumber daya dan wilayah.

    3. Pada halaman Overview, klik nama instans atau klik Instance Management di kolom Actions.

    4. Pada tab Instance Details, di tab Data Table List, klik nama tabel data atau klik Index Management di kolom Actions.

  2. Pada tab Indexes, klik Index Details di kolom Actions untuk indeks pencarian yang ingin Anda kelola.

  3. Pada kotak dialog Index Details, Anda dapat melihat informasi dasar, informasi metering, routing key, bidang indeks, dan pengaturan presorting dari indeks pencarian.

Gunakan CLI Tablestore

Anda dapat menjalankan perintah describe_search_index di CLI Tablestore untuk mengkueri deskripsi indeks pencarian. Untuk informasi selengkapnya, lihat Search index.

Kode contoh berikut menunjukkan cara mengkueri deskripsi indeks pencarian bernama search_index:

describe_search_index -n search_index

Kode berikut menunjukkan contoh output. Pada output perintah, parameter Index schema menunjukkan skema indeks pencarian dan parameter TimeToLive menunjukkan periode validitas data dalam indeks pencarian.

Index schema:
{
    "IndexSetting": {
        "RoutingFields": null
    },
    "FieldSchemas": [
        {
            "FieldName": "id",
            "FieldType": "KEYWORD",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Col_Keyword",
            "FieldType": "KEYWORD",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Col_Long",
            "FieldType": "LONG",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Col_Text",
            "FieldType": "TEXT",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": "single_word",
            "AnalyzerParameter": {
                "CaseSensitive": null,
                "DelimitWord": null
            },
            "EnableSortAndAgg": false,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        },
        {
            "FieldName": "Timestamp",
            "FieldType": "LONG",
            "Index": true,
            "IndexOptions": null,
            "Analyzer": null,
            "AnalyzerParameter": null,
            "EnableSortAndAgg": true,
            "EnableHighlighting": null,
            "Store": false,
            "IsArray": false,
            "FieldSchemas": null,
            "IsVirtualField": false,
            "SourceFieldNames": null,
            "DateFormats": null
        }
    ],
    "IndexSort": {
        "Sorters": [
            {
                "Name": "PrimaryKeySort",
                "Sorter": {
                    "Order": "ASC"
                }
            }
        ]
    }
}
TimeToLive: -1

Gunakan SDK Tablestore

Anda dapat mengkueri deskripsi indeks pencarian menggunakan SDK Tablestore berikut: Tablestore SDK for Java, Tablestore SDK for Go, Tablestore SDK for Python, Tablestore SDK for Node.js, Tablestore SDK for .NET, dan Tablestore SDK for PHP. Dalam contoh ini, digunakan Tablestore SDK for Java.

Contoh berikut mengkueri example_index untuk example_table dan mencetak status indeks, fase sinkronisasi, TTL, serta nama bidang.

String tableName = "example_table";
String indexName = "example_index";
DescribeSearchIndexRequest request = new DescribeSearchIndexRequest();
request.setTableName(tableName);
request.setIndexName(indexName);
request.setIncludeSyncStat(true);

DescribeSearchIndexResponse response = client.describeSearchIndex(request);
System.out.println(response.getIndexStatus().indexStatusEnum);
System.out.println(response.getSyncStat().getSyncPhase());
System.out.println(response.getTimeToLive());
for (FieldSchema fieldSchema : response.getSchema().getFieldSchemas()) {
    System.out.println(fieldSchema.getFieldName());
}

Referensi

Jika indeks pencarian yang ada tidak lagi memenuhi kebutuhan Anda, Anda dapat membuat indeks pencarian baru, memodifikasi skema indeks pencarian yang ada untuk menambah, menghapus, atau mengubah bidang indeks, atau menyesuaikan konfigurasi TTL indeks pencarian. Untuk informasi selengkapnya, lihat Buat indeks pencarian, Modifikasi skema indeks pencarian secara dinamis, dan Tentukan TTL indeks pencarian.