Giter Site home page Giter Site logo

erlastic's Introduction

erlasticsearch

Elasticsearch Erlang Client, OTP 19, rebar3

Overview

This module allows to perform different operations against a single elasticsearch cluster, one of the most interesting features is the bulk indexing that allows to push a number of documents to the cluster, also there is an scroll function that allows to scroll over a set of results from the cluster, that helps to get a big quantity of documents using an iterator, and process them as they are retrieved until the result set is done.

If environment_var atom is used as host, the module will look in the os:getenv(ENV_ELASTICSEARCH_HOST) for the hostname, if var is not yet defined it will default to localhost.

Configuration

%%-*- mode: erlang -*-
[
    {elasticsearch, [
      {host, "localhost"}, %% or environment_var atom
      {port, 9200},
      {ssl, false},
      {max_sessions, 10},
      {shards, 2},
      {replicas, 1},
      {max_pipeline_size, 1},
      {http_options, [{timeout, 1500000}]},
      {basic_auth, {"fake-user", "fake-pass"}}
    ]}
].
% vim:ft=erlang

Ownership

This project is supported by John Diaz, email me for any issues email

Please see project definition documentation

Run: make shell

Eshell V8.2  (abort with ^G)
(erl@local)1> elasticsearch:create_index("index-name").
(erl@local)1> elasticsearch:index_exists("index-name").

WARNING: This will create and delete a test-index Test

Eshell V8.2  (abort with ^G)
(erl@local)1> elasticsearch:test().
Function Parameters Description
create_index/1 "index-name" Checks if the index exists, if not, creates it
create_index/2 "index-name", {Shards, Replicas} Creates an index with settings
path_exists/1 "path" checks a specific path in Elasticsearch "index-name/mapping-name/docId"
bulk/2 {Index, Type}, term() uses bulk api to push documents into elasticsearch, see Bulk Api

An erlang client for elasticsearch's REST interface

erlastic's People

Contributors

elpaisa avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

xxnull

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.