本文整理汇总了C#中Index.CreateAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Index.CreateAsync方法的具体用法?C# Index.CreateAsync怎么用?C# Index.CreateAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index.CreateAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateIndexAsync
/// <summary>
/// Asynchronously creates a new index.
/// </summary>
/// <param name="name">
/// Name of the index to create.
/// </param>
/// <param name="coldPath">
/// Location for storing the cold databases for the index identified by
/// <see cref="name"/>. A value of <c>null</c> or <c>""</c> specifies
/// that the cold databases should be stored at the default location.
/// </param>
/// <param name="homePath">
/// Location for storing the hot and warm buckets for the index
/// identified by <see cref="name"/>. A value of <c>null</c> or <c>""
/// </c> specifies that the hot and warm buckets should be stored at
/// the default location.
/// </param>
/// <param name="thawedPath">
/// <summary>
/// Specifies the absolute path for storing the resurrected databases
/// for the index identified by <see cref="name"/>. A value of <c>null
/// </c> or <c>""</c> specifies that the resurrected databases should
/// be stored at the default location.
/// </param>
/// <param name="attributes">
/// Attributes to set on the newly created index.
/// </param>
/// <returns>
/// An object representing the newly created index.
/// </returns>
/// <remarks>
/// This method uses the <a href="http://goo.gl/yDfQ4T">POST
/// data/indexes</a> endpoint to create the <see cref="Index"/> object
/// it returns.
/// </remarks>
public async Task<Index> CreateIndexAsync(string name, string coldPath = null, string homePath = null,
string thawedPath = null, IndexAttributes attributes = null)
{
var entity = new Index(this.Context, this.Namespace, name);
await entity.CreateAsync(coldPath, homePath, thawedPath, attributes);
return entity;
}