public MonthlyEmployeeIndex(IElasticConfiguration configuration, int version) : base(configuration, "monthly-employees", version)
 {
     AddAlias($"{Name}-today", TimeSpan.FromDays(1));
     AddAlias($"{Name}-last7days", TimeSpan.FromDays(7));
     AddAlias($"{Name}-last30days", TimeSpan.FromDays(30));
     AddAlias($"{Name}-last60days", TimeSpan.FromDays(60));
 }
예제 #2
0
 public DailyLogEventIndex(IElasticConfiguration configuration) : base(configuration, "daily-logevents", 1)
 {
     AddType(LogEvent = new LogEventType(this));
     AddAlias($"{Name}-today", TimeSpan.FromDays(1));
     AddAlias($"{Name}-last7days", TimeSpan.FromDays(7));
     AddAlias($"{Name}-last30days", TimeSpan.FromDays(30));
 }
 public DailyEmployeeIndex(IElasticConfiguration configuration, int version) : base(configuration, "daily-employees", version)
 {
     AddType(Employee = new DailyEmployeeType(this));
     AddAlias($"{Name}-today", TimeSpan.FromDays(1));
     AddAlias($"{Name}-last7days", TimeSpan.FromDays(7));
     AddAlias($"{Name}-last30days", TimeSpan.FromDays(30));
 }
예제 #4
0
 public DailyIndex(IElasticConfiguration configuration, string name, int version = 1)
     : base(configuration, name, version)
 {
     AddAlias(Name);
     _frozenAliases = new Lazy <IReadOnlyCollection <IndexAliasAge> >(() => _aliases.AsReadOnly());
     _aliasCache    = new ScopedCacheClient(configuration.Cache, "alias");
 }
 public MonthlyEmployeeIndex(IElasticConfiguration configuration, int version) : base(configuration, "monthly-employees", version) {
     AddType(Employee = new MonthlyEmployeeType(this));
     AddAlias($"{Name}-today", TimeSpan.FromDays(1));
     AddAlias($"{Name}-last7days", TimeSpan.FromDays(7));
     AddAlias($"{Name}-last30days", TimeSpan.FromDays(30));
     AddAlias($"{Name}-last60days", TimeSpan.FromDays(60));
 }
 public VersionedEmployeeIndex(IElasticConfiguration configuration, int version) : base(configuration, "employees", version)
 {
     AddType(Employee = new EmployeeType(this));
     AddReindexScript(20, "ctx._source.companyName = 'scripted';");
     AddReindexScript(21, "ctx._source.companyName = 'NOOO';", "notEmployee");
     AddReindexScript(21, "ctx._source.companyName = 'typed script';", "employee");
     AddReindexScript(22, "ctx._source.FAIL = 'should not work");
 }
 public OrganizationIndex(IElasticConfiguration configuration) : base(configuration, Settings.Current.AppScopePrefix + "organizations", 1)
 {
     AddType(Organization = new OrganizationIndexType(this));
     AddType(Project      = new ProjectIndexType(this));
     AddType(Token        = new TokenIndexType(this));
     AddType(User         = new UserIndexType(this));
     AddType(WebHook      = new WebHookIndexType(this));
 }
 public IndexBase(IElasticConfiguration configuration, string name)
 {
     Name          = name;
     Configuration = configuration;
     _lockProvider = new CacheLockProvider(configuration.Cache, configuration.MessageBus, configuration.LoggerFactory);
     _logger       = configuration.LoggerFactory.CreateLogger(GetType());
     _frozenTypes  = new Lazy <IReadOnlyCollection <IIndexType> >(() => _types.AsReadOnly());
 }
 public OrganizationIndex(IElasticConfiguration configuration)
     : base(configuration, Settings.Current.AppScopePrefix + "organization", 18)
 {
     AddType(OrganizationType = new OrganizationType(this));
     AddType(UserType         = new UserType(this));
     AddType(TokenType        = new TokenType(this));
     AddType(NotificationType = new NotificationType(this));
     AddType(MigrationType    = new MigrationType(this));
 }
예제 #10
0
 public ElasticMigrationJobBase(MigrationManager migrationManager, IElasticConfiguration configuration, ILoggerFactory loggerFactory = null)
     : base(loggerFactory)
 {
     _migrationManager = new Lazy <MigrationManager>(() => {
         Configure(migrationManager);
         return(migrationManager);
     });
     _configuration = configuration;
 }
예제 #11
0
 public Index(IElasticConfiguration configuration, string name = null)
 {
     Name             = name;
     Configuration    = configuration;
     _queryBuilder    = new Lazy <IElasticQueryBuilder>(CreateQueryBuilder);
     _queryParser     = new Lazy <ElasticQueryParser>(CreateQueryParser);
     _mappingResolver = new Lazy <ElasticMappingResolver>(CreateMappingResolver);
     _fieldResolver   = new Lazy <QueryFieldResolver>(CreateQueryFieldResolver);
     _logger          = configuration.LoggerFactory?.CreateLogger(GetType()) ?? NullLogger.Instance;
 }
예제 #12
0
        public EventIndex(IElasticConfiguration configuration) : base(configuration, Settings.Current.AppScopePrefix + "events", 1)
        {
            MaxIndexAge = TimeSpan.FromDays(180);

            AddType(Event = new EventIndexType(this));
            AddAlias($"{Name}-today", TimeSpan.FromDays(1));
            AddAlias($"{Name}-last3days", TimeSpan.FromDays(7));
            AddAlias($"{Name}-last7days", TimeSpan.FromDays(7));
            AddAlias($"{Name}-last30days", TimeSpan.FromDays(30));
            AddAlias($"{Name}-last90days", TimeSpan.FromDays(90));
        }
예제 #13
0
        public DailyIndex(IElasticConfiguration configuration, string name, int version = 1, Func <object, DateTime> getDocumentDateUtc = null)
            : base(configuration, name, version)
        {
            AddAlias(Name);
            _frozenAliases      = new Lazy <IReadOnlyCollection <IndexAliasAge> >(() => _aliases.AsReadOnly());
            _aliasCache         = new ScopedCacheClient(configuration.Cache, "alias");
            _getDocumentDateUtc = getDocumentDateUtc;
            _defaultIndexes     = new[] { Name };
            HasMultipleIndexes  = true;

            if (_getDocumentDateUtc != null)
            {
                _getDocumentDateUtc = (document) => {
                    var date = getDocumentDateUtc(document);
                    return(date != DateTime.MinValue ? date : DefaultDocumentDateFunc(document));
                }
            }
            ;
            else
            {
                _getDocumentDateUtc = DefaultDocumentDateFunc;
            }
        }
 public ParentChildIndex(IElasticConfiguration configuration): base(configuration, "parentchild", 1) {
     AddType(Parent = new ParentType(this));
     AddType(Child = new ChildType(this));
 }
 public IdentityIndex(IElasticConfiguration configuration) : base(configuration, "identity") {
     AddType(Identity = new IdentityType(this));
 }
 public MonthlyLogEventIndex(IElasticConfiguration configuration) : base(configuration, "monthly-logevents", 1)
 {
     AddType(LogEvent = new LogEventType(this));
     AddAlias($"{Name}-thismonth", TimeSpan.FromDays(32));
     AddAlias($"{Name}-last3months", TimeSpan.FromDays(100));
 }
 public VersionedIndex(IElasticConfiguration configuration, string name, int version = 1)
     : base(configuration, name) {
     Version = version;
     VersionedName = String.Concat(Name, "-v", Version);
 }
예제 #18
0
 public IdentityIndex(IElasticConfiguration configuration) : base(configuration, "identity")
 {
 }
예제 #19
0
 public MonthlyIndex(IElasticConfiguration configuration, string name, int version = 1)
     : base(configuration, name, version)
 {
     DateFormat = "yyyy.MM";
 }
예제 #20
0
 public IdentityIndex(IElasticConfiguration configuration) : base(configuration, "identity")
 {
     AddType(Identity = new IdentityType(this));
 }
 public EmployeeIndex(IElasticConfiguration configuration) : base(configuration, "employees")
 {
     AddType(Employee = new EmployeeType(this));
 }
 public MonthlyLogEventIndex(IElasticConfiguration configuration) : base(configuration, "monthly-logevents", 1) {
     AddType(LogEvent = new LogEventType(this));
     AddAlias($"{Name}-thismonth", TimeSpan.FromDays(32));
     AddAlias($"{Name}-last3months", TimeSpan.FromDays(100));
 }
 public ParentChildIndex(IElasticConfiguration configuration) : base(configuration, "parentchild", 1)
 {
 }
예제 #24
0
 public MonthlyIndex(IElasticConfiguration configuration, string name, int version = 1, Func <object, DateTime> getDocumentDateUtc = null)
     : base(configuration, name, version, getDocumentDateUtc)
 {
     DateFormat = "yyyy.MM";
 }
예제 #25
0
 public StackIndex(IElasticConfiguration configuration) : base(configuration, Settings.Current.AppScopePrefix + "stacks", 1)
 {
     AddType(Stack = new StackIndexType(this));
 }
예제 #26
0
 public ParentChildIndex(IElasticConfiguration configuration) : base(configuration, "parentchild", 1)
 {
     AddType(Parent = new ParentType(this));
     AddType(Child  = new ChildType(this));
 }
 public VersionedEmployeeIndex(IElasticConfiguration configuration, int version) : base(configuration, "employees", version)
 {
     AddType(Employee = new EmployeeType(this));
 }
 public VersionedEmployeeIndex(IElasticConfiguration configuration, int version) : base(configuration, "employees", version) {
     AddType(Employee = new EmployeeType(this));
 }
 public DailyEmployeeIndexWithWrongEmployeeType(IElasticConfiguration configuration, int version) : base(configuration, "daily-employees", version)
 {
     AddType(Employee = new EmployeeType(this));
 }
 public DailyEmployeeIndexWithWrongEmployeeType(IElasticConfiguration configuration, int version) : base(configuration, "daily-employees", version) {
     AddType(Employee = new EmployeeType(this));
 }
예제 #31
0
 public VersionedIndex(IElasticConfiguration configuration, string name, int version = 1)
     : base(configuration, name)
 {
     Version       = version;
     VersionedName = String.Concat(Name, "-v", Version);
 }
 public EmployeeIndex(IElasticConfiguration configuration): base(configuration, "employees") {
     AddType(Employee = new EmployeeType(this));
 }
 public DailyLogEventIndex(IElasticConfiguration configuration) : base(configuration, "daily-logevents", 1) {
     AddType(LogEvent = new LogEventType(this));
     AddAlias($"{Name}-today", TimeSpan.FromDays(1));
     AddAlias($"{Name}-last7days", TimeSpan.FromDays(7));
     AddAlias($"{Name}-last30days", TimeSpan.FromDays(30));
 }
 public EmployeeIndex(IElasticConfiguration configuration) : base(configuration, "employees")
 {
 }
예제 #35
0
 public MigrationIndex(IElasticConfiguration configuration, string name = "migration", int replicas = 1) : base(configuration, name)
 {
     _replicas = replicas;
 }
예제 #36
0
 public DailyLogEventIndex(IElasticConfiguration configuration) : base(configuration, "daily-logevents", 1, doc => ((LogEvent)doc).Date.UtcDateTime)
 {
     AddAlias($"{Name}-today", TimeSpan.FromDays(1));
     AddAlias($"{Name}-last7days", TimeSpan.FromDays(7));
     AddAlias($"{Name}-last30days", TimeSpan.FromDays(30));
 }
예제 #37
0
 public LogstashIndex(IElasticConfiguration configuration)
     : base(configuration, Settings.Current.AppScopePrefix + "logstash")
 {
     AddType(LogEventType = new LogEventType(this, "logevent"));
 }
 public EmployeeIndexWithYearsEmployed(IElasticConfiguration configuration) : base(configuration, "employees")
 {
 }
예제 #39
0
 public Index(IElasticConfiguration configuration, string name) : base(configuration, name)
 {
 }
예제 #40
0
 public Index(IElasticConfiguration configuration, string name) : base(configuration, name) {}