2

我的应用程序使用了几个搜索,它们是相对较大的搜索,每个都有数百万个文档,我希望简单地显示等待在我的应用程序页面上运行的索引器队列。这样我就可以更好地了解将完成什么以及何时完成,因为我大致知道每个人应该花费多长时间。

我能够找到当前正在进行的,但找不到尚未在 SDK 中运行的。我已经在 SDK 中进行了一些挖掘,但什么也没发现,我也没有在文档中看到任何提及它的内容

https://docs.microsoft.com/en-us/rest/api/searchservice/indexer-operations

它似乎不是一种选择,但我不确定为什么它不会

https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.search.models.indexerexecutioninfo?view=azure-dotnet

这里似乎也没有关于计划运行的任何内容

这是索引器类

public class Indexer : IResourceWithETag
{
    //
    // Summary:
    //     Initializes a new instance of the Indexer class.
    public Indexer();
    //
    // Summary:
    //     Initializes a new instance of the Indexer class.
    //
    // Parameters:
    //   name:
    //     The name of the indexer.
    //
    //   dataSourceName:
    //     The name of the datasource from which this indexer reads data.
    //
    //   targetIndexName:
    //     The name of the index to which this indexer writes data.
    //
    //   description:
    //     The description of the indexer.
    //
    //   schedule:
    //     The schedule for this indexer.
    //
    //   parameters:
    //     Parameters for indexer execution.
    //
    //   fieldMappings:
    //     Defines mappings between fields in the data source and corresponding target fields
    //     in the index.
    //
    //   isDisabled:
    //     A value indicating whether the indexer is disabled. Default is false.
    //
    //   eTag:
    //     The ETag of the Indexer.
    public Indexer(string name, string dataSourceName, string targetIndexName, string description = null, IndexingSchedule schedule = null, IndexingParameters parameters = null, IList<FieldMapping> fieldMappings = null, bool? isDisabled = null, string eTag = null);

    //
    // Summary:
    //     Gets or sets the name of the indexer.
    [JsonProperty(PropertyName = "name")]
    public string Name { get; set; }
    //
    // Summary:
    //     Gets or sets the description of the indexer.
    [JsonProperty(PropertyName = "description")]
    public string Description { get; set; }
    //
    // Summary:
    //     Gets or sets the name of the datasource from which this indexer reads data.
    [JsonProperty(PropertyName = "dataSourceName")]
    public string DataSourceName { get; set; }
    //
    // Summary:
    //     Gets or sets the name of the index to which this indexer writes data.
    [JsonProperty(PropertyName = "targetIndexName")]
    public string TargetIndexName { get; set; }
    //
    // Summary:
    //     Gets or sets the schedule for this indexer.
    [JsonProperty(PropertyName = "schedule")]
    public IndexingSchedule Schedule { get; set; }
    //
    // Summary:
    //     Gets or sets parameters for indexer execution.
    [JsonProperty(PropertyName = "parameters")]
    public IndexingParameters Parameters { get; set; }
    //
    // Summary:
    //     Gets or sets defines mappings between fields in the data source and corresponding
    //     target fields in the index.
    [JsonProperty(PropertyName = "fieldMappings")]
    public IList<FieldMapping> FieldMappings { get; set; }
    //
    // Summary:
    //     Gets or sets a value indicating whether the indexer is disabled. Default is false.
    [JsonProperty(PropertyName = "disabled")]
    public bool? IsDisabled { get; set; }
    //
    // Summary:
    //     Gets or sets the ETag of the Indexer.
    [JsonProperty(PropertyName = "@odata.etag")]
    public string ETag { get; set; }

    //
    // Summary:
    //     Validate the object.
    //
    // Exceptions:
    //   T:Microsoft.Rest.ValidationException:
    //     Thrown if validation fails
    public virtual void Validate();
}

由于我只关心在任何时间点同时运行多个索引器,而不是按计划进行,因此索引计划不会给我所需的信息

//
// Summary:
//     Represents a schedule for indexer execution.
public class IndexingSchedule
{
    //
    // Summary:
    //     Initializes a new instance of the IndexingSchedule class.
    public IndexingSchedule();
    //
    // Summary:
    //     Initializes a new instance of the IndexingSchedule class.
    //
    // Parameters:
    //   interval:
    //     The interval of time between indexer executions.
    //
    //   startTime:
    //     The time when an indexer should start running.
    public IndexingSchedule(TimeSpan interval, DateTimeOffset? startTime = null);

    //
    // Summary:
    //     Gets or sets the interval of time between indexer executions.
    [JsonProperty(PropertyName = "interval")]
    public TimeSpan Interval { get; set; }
    //
    // Summary:
    //     Gets or sets the time when an indexer should start running.
    [JsonProperty(PropertyName = "startTime")]
    public DateTimeOffset? StartTime { get; set; }

    //
    // Summary:
    //     Validate the object.
    //
    // Exceptions:
    //   T:Microsoft.Rest.ValidationException:
    //     Thrown if validation fails
    public virtual void Validate();
}
4

1 回答 1

0

SDK 不提供在快速连续启动时查看接下来将运行哪些索引器的功能。如果您想请求执行此操作的能力,请在Azure 搜索 UserVoice上添加此建议。

于 2019-03-13T21:36:05.387 回答