Connecting To Elastic Search With Dotnet Nest Helper Package

Elasticsearch is a search engine based on Lucene. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents
by the time of writing this post ES is the most popular search engine and the 8th DBMS   the best thing about elastic search is that you just need to send data to the engine and it handles everything it self and you can extract any information from its popular tool , kibana , to show some insights to your clients or managers.

ES supports many programming languages and we are going to see how we can use Nest  , the dotnet client provided by ES to connect to ES throughout dotnet .

if you want to learn NEST you need to go over the documentations of ES and Nest , but if you want to use ES really quickly ,you can begin using my repository on github , you can use it to manage your connection to ES and use a few helpful methods to make it easier to interact with data.

this package is made on top of nest client so you just install this nuget package to install both 'nest' and 'nest helper' packages  .

Elastic Search Helper Module, helps you easily connect to elastic search and query data using ES Nest library
Features:
  • create mappings
  • manage ES production and test environments
  • some helpers methods to query ES
  • access to ES Nest connestion
  • copy and paste data from two resources

inorder to start using this package you must to define your mappings first :

ES.Helper.ElasticConnection.Init(
   new Dictionary() { {typeof(MyClass),"table_name" }},"database_name");


the you can define your own implementation by inheriting ElasticConnection :

public class ElasticSearchManger :ES.Helper.ElasticConnection {
 public ElasticSearchManger() { 
     Init(new Dictionary() { {
      typeof(Models.MyClass),"tablename" },"db_name"); 
     SetToTestMode(); 
   }
 }


or if you use any DI you can just define ES.Helper.IElasticConnection in your DI configuration .

Comments

Popular posts from this blog

Xamarin Forms , Designer Tools

How To Run Xamarin Forms Previewer Beta On Windows

Google Firebase - Easy Steps To Run Your Chrome Notification Service