private IAlias AliasFilterFor <TRoyal>(AliasDescriptor a) where TRoyal : class, IRoyal => a.Filter <TRoyal>(f => f.Term(p => p.Join, Infer.Relation <TRoyal>()));
#pragma warning disable 618 private Task <CreateIndexResponse> CreateProjectIndexAsync() => Client.Indices.CreateAsync(typeof(Project), c => c .Settings(settings => settings.Analysis(ProjectAnalysisSettings)) // this uses obsolete overload somewhat on purpose to make sure it works just as the rest // TODO 8.0 remove with once the overloads are gone too .Mappings(ProjectMappings) .Aliases(aliases => aliases .Alias(ProjectsAliasName) .Alias(ProjectsAliasFilter, a => a .Filter <Project>(f => f.Term(p => p.Join, Infer.Relation <Project>())) ) .Alias(CommitsAliasFilter, a => a .Filter <CommitActivity>(f => f.Term(p => p.Join, Infer.Relation <CommitActivity>())) ) ) );
private void CreateProjectIndex() { var createProjectIndex = this.Client.CreateIndex(typeof(Project), c => c .Settings(settings => settings .Analysis(ProjectAnalysisSettings) ) .Aliases(aliases => aliases .Alias(ProjectsAliasName) .Alias(ProjectsAliasFilter, a => a .Filter <Project>(f => f.Term(p => p.Join, Infer.Relation <Project>())) ) .Alias(CommitsAliasFilter, a => a .Filter <CommitActivity>(f => f.Term(p => p.Join, Infer.Relation <CommitActivity>())) ) ) .Mappings(map => map .Map <Project>(m => m .RoutingField(r => r.Required()) .AutoMap() .Properties(ProjectProperties) .Properties <CommitActivity>(props => props .Object <Developer>(o => o .AutoMap() .Name(p => p.Committer) .Properties(DeveloperProperties) ) .Text(t => t .Name(p => p.ProjectName) .Index(false) ) ) ) ) ); createProjectIndex.ShouldBeValid(); }