-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from VahidFarahmandian/67-partition-indexes-us…
…ing-partition-key partitioning documents based on the partition key
- Loading branch information
Showing
25 changed files
with
481 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 8 additions & 13 deletions
21
03-Infrastructure/Jinget.Logger/Handlers/CommandHandlers/ElasticSearchBaseDomainService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Jinget.Logger.Entities; | ||
using Jinget.Logger.Entities.Log.Base; | ||
using Jinget.Logger.ViewModels; | ||
|
||
namespace Jinget.Logger.Handlers.CommandHandlers | ||
{ | ||
public class ElasticSearchBaseDomainService<TModelType, TKeyType> : | ||
IElasticSearchBaseDomainService<TModelType, TKeyType> | ||
where TModelType : BaseEntity<TKeyType> | ||
public class ElasticSearchBaseDomainService<TModelType> : | ||
IElasticSearchBaseDomainService<TModelType> | ||
where TModelType : LogBaseEntity | ||
{ | ||
protected readonly IElasticSearchRepository<TModelType, TKeyType> Repository; | ||
protected readonly IElasticSearchRepository<TModelType> Repository; | ||
|
||
public ElasticSearchBaseDomainService(IElasticSearchRepository<TModelType, TKeyType> repository) => Repository = repository; | ||
public ElasticSearchBaseDomainService(IElasticSearchRepository<TModelType> repository) => Repository = repository; | ||
|
||
public virtual async Task<bool> CreateAsync(TModelType param) => await Repository.IndexAsync(param); | ||
public virtual async Task<bool> BulkCreateAsync(IList<TModelType> @params) => await Repository.BulkIndexAsync(@params); | ||
|
||
public virtual async Task<TModelType> FetchLatestAsync() => await Repository.GetLatestAsync(); | ||
|
||
//public virtual async Task<(IReadOnlyCollection<TModelType> Records, long TotalRecordCount)> FetchAllAsync( | ||
// Func<QueryContainerDescriptor<TModelType>, QueryContainer> filter = null, | ||
// Func<SortDescriptor<TModelType>, IPromise<IList<ISort>>> orderBy = null, | ||
// int? pageSize = 0, | ||
// int? pageIndex = -1) => await Repository.QueryAsync(filter, orderBy, pageSize, pageIndex); | ||
public virtual async Task<List<LogSearchViewModel>> SearchAsync(string partitionKey, string searchString, int pageNumber, int pageSize, string username = "") => await Repository.SearchAsync(partitionKey, searchString, pageNumber, pageSize, username); | ||
} | ||
} |
14 changes: 5 additions & 9 deletions
14
03-Infrastructure/Jinget.Logger/Handlers/CommandHandlers/IElasticSearchBaseDomainService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Jinget.Logger.Entities; | ||
using Jinget.Logger.Entities.Log.Base; | ||
using Jinget.Logger.ViewModels; | ||
|
||
namespace Jinget.Logger.Handlers.CommandHandlers | ||
{ | ||
public interface IElasticSearchBaseDomainService<TModelType, TKeyType> | ||
where TModelType : BaseEntity<TKeyType> | ||
public interface IElasticSearchBaseDomainService<TModelType> | ||
where TModelType : LogBaseEntity | ||
{ | ||
Task<TModelType> FetchLatestAsync(); | ||
|
||
Task<bool> CreateAsync(TModelType param); | ||
|
||
Task<bool> BulkCreateAsync(IList<TModelType> @params); | ||
|
||
//Task<(IReadOnlyCollection<TModelType> Records, long TotalRecordCount)> FetchAllAsync( | ||
// Func<QueryContainerDescriptor<TModelType>, QueryContainer> filter = null, | ||
// Func<SortDescriptor<TModelType>, IPromise<IList<ISort>>> orderBy = null, | ||
// int? pageSize = 0, | ||
// int? pageIndex = -1); | ||
Task<List<LogSearchViewModel>> SearchAsync(string partitionKey, string searchString, int pageNumber, int pageSize, string username = ""); | ||
} | ||
} |
Oops, something went wrong.