Skip to content

elpaisa/erlangelk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

erlangelk

Run: bash dev.sh

Eshell V8.2  (abort with ^G)
(erl@local)1> elasticsearch:start().
(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_index/2 {Index, Type}, IndexTypeIdJsonTup uses bulk api to push documents into elasticsearch, see Bulk Api

Most of this code was taken from

An erlang client for elasticsearch's REST interface

other elasticsearch clients and why this was made

  • erlasticsearch - too much frustration with thrift.
  • erlastic_search - dependency on hackney for http requests (built-in pooling is broken); unable to configure without wrapping the module.