建立多元索引後,使用DescribeSearchIndex介面可以查詢多元索引的描述資訊,包括多元索引的欄位資訊、索引配置、計量資訊、建立時間、TTL等。

前提條件

  • 已初始化OTSClient。具體操作,請參見初始化
  • 已建立資料表並寫入資料。
  • 已在資料表上建立多元索引。具體操作,請參見建立多元索引

參數

參數 說明
TableName 資料表名稱。
IndexName 多元索引名稱。

樣本

/// <summary>
/// 查詢多元索引的描述資訊。
/// </summary>
/// <param name="otsClient"></param>
public static void DescribeSearchIndex(OTSClient otsClient)
{
    //設定資料表名稱和多元索引名稱。
    DescribeSearchIndexRequest request = new DescribeSearchIndexRequest(TableName, IndexName);

    DescribeSearchIndexResponse response = otsClient.DescribeSearchIndex(request);
    string serializedObjectString = JsonConvert.SerializeObject(response);
    Console.WriteLine(serializedObjectString); //列印response的詳細資料。
}