Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/realliangshiwei/abp.elasticsearch
AbpElasticSearch module
https://github.com/realliangshiwei/abp.elasticsearch
abp abpplug aspnetboilerplate
Last synced: 16 days ago
JSON representation
AbpElasticSearch module
- Host: GitHub
- URL: https://github.com/realliangshiwei/abp.elasticsearch
- Owner: realLiangshiwei
- License: mit
- Created: 2017-11-17T03:06:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-13T12:38:12.000Z (over 2 years ago)
- Last Synced: 2024-10-13T05:38:51.343Z (about 1 month ago)
- Topics: abp, abpplug, aspnetboilerplate
- Language: C#
- Homepage:
- Size: 1.16 MB
- Stars: 62
- Watchers: 8
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AbpElasticSearch Module
aspnetboilerplate repository
> https://github.com/aspnetboilerplate/aspnetboilerplateNuget
> https://www.nuget.org/packages/Abp.ElasticSearch/## Get Started
in Visual Studio,using the Package Manager Console :
> Install-Package Abp.ElasticSearchcore Proejct open Module cs file
``` csharp
[DependsOn(typeof(AbpElasticSearchModule))]
public class CodeModule : AbpModule
{public override void PreInitialize()
{
Configuration.Modules.ElasticSearch().ConnectionString = "your connection string";
Configuration.Modules.ElasticSearch().AuthUserName = "your auth username";
Configuration.Modules.ElasticSearch().AuthPassWord = "your auth password";
//
}public override void Initialize()
{
//
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
}
}
```### Sample
You can see the [sample](https://github.com/realLiangshiwei/Abp.ElasticSearch/tree/master/Samples/BookStore) to learn the basic usage;
![](/img/1.png)
![](/img/2.png)
### API List
``` csharp
///
/// CreateEsIndex auto Mapping T Property
/// Auto Set Alias alias is Input IndexName
///
///
///
///
///
Task CreateIndexAsync(string indexName, int shard = 1, int numberOfReplicas = 1)
where T: class;Task CreateIndexAsync(string indexName, Func selector)
where T: class;///
/// ReIndex
///
///
///
///
Task ReIndex(string indexName) where T : class;///
/// AddOrUpdate Document
///
///
///
///
///
Task AddOrUpdateAsync(string indexName, T model) where T : class;///
/// Bulk AddOrUpdate Document,Default bulkNum is 1000
///
///
///
///
///
Task BulkAddOrUpdateAsync(string indexName, List list)
where T : class;///
/// Bulk Delete Document,Default bulkNum is 1000
///
///
///
///
///
Task BulkDeleteAsync(string indexName, List list) where T : class;///
/// Delete Document
///
///
///
///
///
Task DeleteAsync(string indexName, T model) where T : class;///
/// Delete Index
///
///
///
Task DeleteIndexAsync(string indexName);///
/// Non-stop Update Documents
///
///
///
///
Task ReBuild(string indexName) where T : class;///
/// search
///
///
///
///
/// skip num
/// return document size
/// return fields
/// Highlight tags
/// Highlight tags
///
/// Highlight fields
///
Task> SearchAsync(
string indexName,
SearchDescriptor query = null,
int skip = 0,
int size = 20,
string[] includeFields = null,
string preTags = "", string postTags = "", bool disableHigh = false,
string[] highFields = null)
where T : class;Task CountAsync(string indexName) where T : class;
Task CountAsync(string indexName,
Func, QueryContainer> query) where T : class;```