Giter Site home page Giter Site logo

abp.elasticsearch's Introduction

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

[DependsOn(typeof(AbpElasticSearchModule))]
public class CodeModule : AbpModule
{

    public override void PreInitialize()
    {
        Configuration.Modules.ElasticSearch().ConnectionString = "your collectionstring";
        Configuration.Modules.ElasticSearch().AuthUserName = "your authusername";
        Configuration.Modules.ElasticSearch().AuthPassWord = "your authpassword";
        //
    }

    public override void Initialize()
    {
        // 
        IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
    }
}

API List

/// <summary>
/// CreateEsIndex Not Mapping
/// Auto Set Alias alias is Input IndexName
/// </summary>
/// <param name="indexName"></param>
/// <param name="shard"></param>
/// <param name="numberOfReplicas"></param>
/// <returns></returns>
Task CrateIndexAsync(string indexName, int shard = 1, int numberOfReplicas = 1);

/// <summary>
/// CreateEsIndex auto Mapping T Property
/// Auto Set Alias alias is Input IndexName
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <param name="shard"></param>
/// <param name="numberOfReplicas"></param>
/// <returns></returns>
Task CreateIndexAsync<T, TKey>(string indexName, int shard = 1, int numberOfReplicas = 1) where T : EntityDto<TKey>;

/// <summary>
/// ReIndex
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <returns></returns>
Task ReIndex<T, TKey>(string indexName) where T : EntityDto<TKey>;


/// <summary>
/// AddOrUpdate Document
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <param name="model"></param>
/// <returns></returns>
Task AddOrUpdateAsync<T, TKey>(string indexName, T model) where T : EntityDto<TKey>;


/// <summary>
/// Bulk AddOrUpdate Document,Default bulkNum is 1000
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <param name="list"></param>
/// <param name="bulkNum">bulkNum</param>
/// <returns></returns>
Task BulkAddorUpdateAsync<T, TKey>(string indexName, List<T> list, int bulkNum = 1000) where T : EntityDto<TKey>;

/// <summary>
///  Bulk Delete Document,Default bulkNum is 1000
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <param name="list"></param>
/// <param name="bulkNum">bulkNum</param>
/// <returns></returns>
Task BulkDeleteAsync<T, TKey>(string indexName, List<T> list, int bulkNum = 1000) where T : EntityDto<TKey>;

/// <summary>
/// Delete Document
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <param name="typeName"></param>
/// <param name="model"></param>
/// <returns></returns>
Task DeleteAsync<T, TKey>(string indexName, T model) where T : EntityDto<TKey>;

/// <summary>
/// Delete Index
/// </summary>
/// <param name="indexName"></param>
/// <returns></returns>
Task DeleteIndexAsync(string indexName);


/// <summary>
/// Non-stop Update Documents
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <returns></returns>
Task ReBuild<T, TKey>(string indexName) where T : EntityDto<TKey>;

/// <summary>
/// search
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="indexName"></param>
/// <param name="query"></param>
/// <param name="skip">skip num</param>
/// <param name="size">return document size</param>
/// <param name="includeFields">return fields</param>
/// <param name="preTags">Highlight tags</param>
/// <param name="postTags">Highlight tags</param>
/// <param name="disableHigh"></param>
/// <param name="highField">Highlight fields</param>
/// <returns></returns>
Task<ISearchResponse<T>> SearchAsync<T, TKey>(string indexName, SearchDescriptor<T> query,
    int skip, int size, string[] includeFields = null, string preTags = "<strong style=\"color: red;\">",
    string postTags = "</strong>", bool disableHigh = false, params string[] highField) where T : EntityDto<TKey>;

abp.elasticsearch's People

Contributors

realliangshiwei avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.