using Elsa.Elasticsearch.Common;
using Elsa.Elasticsearch.Models;
using Elsa.Elasticsearch.Options;
using Elsa.Workflows.Management.Features;
namespace Elsa.Elasticsearch.Modules.Management;
public static class Extensions
{
///
/// Configures the to use the .
///
public static WorkflowInstanceFeature UseElasticsearch(
this WorkflowInstanceFeature feature,
ElasticsearchOptions options,
IndexRolloverStrategy? rolloverStrategy = default,
IDictionary? indexConfig = default,
Action? configure = default)
{
configure += f =>
{
f.Options = options;
f.IndexRolloverStrategy = rolloverStrategy;
f.IndexConfig = Utils.ResolveAliasConfig(f.IndexConfig, options.IndexConfig, indexConfig);
};
feature.Module.Configure(configure);
return feature;
}
}