Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# AbpElasticSearch Module
aspnetboilerplate repository
> https://github.com/aspnetboilerplate/aspnetboilerplate

Nuget
> https://www.nuget.org/packages/Abp.ElasticSearch/

## Get Started

in Visual Studio,using the Package Manager Console :
> Install-Package Abp.ElasticSearch

core 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;

```