Если я быстро запускаю несколько поисковых индексаторов Azure, есть ли способ получить доступ к этой очереди ожидающих индексаторов в Azure SDK? - PullRequest
1 голос
/ 13 марта 2019

У меня есть несколько поисков, которые использует мое приложение, и это относительно большие запросы, по миллионам документов каждый, я просто хочу отобразить очередь индексаторов, ожидающих запуска на странице в моем приложении. Это позволяет мне лучше понять, что будет закончено, и когда с тех пор я примерно знаю, сколько времени потребуется каждому.

Я могу найти тот, который выполняется в данный момент, но не тот, который еще не запущен в 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

Здесь, похоже, тоже ничего не говорится о запланированном запуске

Это класс Indexer

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();
}

1 Ответ

0 голосов
/ 14 марта 2019

SDK не предоставляет возможность увидеть, какие индексаторы будут работать в следующем, если они начнутся в быстрой последовательности. Если вы хотите запросить возможность сделать это, добавьте это предложение в Azure Search UserVoice .

...