All Projects → DhavalKapil → Elasticsearch Lua

DhavalKapil / Elasticsearch Lua

Licence: mit
Lua client for Elasticsearch

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Elasticsearch Lua

Samsara
Samsara is a real-time analytics platform
Stars: ✭ 132 (-8.97%)
Mutual labels:  elasticsearch
Elasticsearch Dataformat
Excel/CSV/BulkJSON downloads on Elasticsearch.
Stars: ✭ 135 (-6.9%)
Mutual labels:  elasticsearch
Chewy
High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
Stars: ✭ 1,749 (+1106.21%)
Mutual labels:  elasticsearch
Echo
🦄 开源社区系统:基于 SpringBoot + MyBatis + MySQL + Redis + Kafka + Elasticsearch + Spring Security + ... 并提供详细的开发文档和配套教程。包含帖子、评论、私信、系统通知、点赞、关注、搜索、用户设置、数据统计等模块。
Stars: ✭ 129 (-11.03%)
Mutual labels:  elasticsearch
Elastic Stack
Aprenda Elasticsearch, Logstash, Kibana e Beats do jeito mais fácil ⭐️
Stars: ✭ 135 (-6.9%)
Mutual labels:  elasticsearch
Django Zombodb
Easy Django integration with Elasticsearch through ZomboDB Postgres Extension
Stars: ✭ 136 (-6.21%)
Mutual labels:  elasticsearch
Vagrant Elastic Stack
Giving the Elastic Stack a try in Vagrant
Stars: ✭ 131 (-9.66%)
Mutual labels:  elasticsearch
Sns Forum Website
牛客网高级项目(SNS+社区问答类网站)
Stars: ✭ 143 (-1.38%)
Mutual labels:  elasticsearch
Vue Innersearch
🔎 UI components built with Vue.js for ElasticSearch
Stars: ✭ 135 (-6.9%)
Mutual labels:  elasticsearch
Es Utils
ElasticSearch Utilities
Stars: ✭ 137 (-5.52%)
Mutual labels:  elasticsearch
Elyzer
"Stop worrying about Elasticsearch analyzers", my therapist says
Stars: ✭ 134 (-7.59%)
Mutual labels:  elasticsearch
Docker Elk
The Elastic stack (ELK) powered by Docker and Compose.
Stars: ✭ 12,327 (+8401.38%)
Mutual labels:  elasticsearch
Terraform Aws Elasticsearch
Terraform module to provision an Elasticsearch cluster with built-in integrations with Kibana and Logstash.
Stars: ✭ 137 (-5.52%)
Mutual labels:  elasticsearch
Elasticsearch tutorial
An action-packed, example-based ElasticSearch tutorial
Stars: ✭ 133 (-8.28%)
Mutual labels:  elasticsearch
Elastiknn
Elasticsearch plugin for nearest neighbor search. Store vectors and run similarity search using exact and approximate algorithms.
Stars: ✭ 139 (-4.14%)
Mutual labels:  elasticsearch
Mongolastic
🚥 A dataset migration tool from MongoDB to Elasticsearch and vice versa.
Stars: ✭ 131 (-9.66%)
Mutual labels:  elasticsearch
Elk Hole
elasticsearch, logstash and kibana configuration for pi-hole visualiziation
Stars: ✭ 136 (-6.21%)
Mutual labels:  elasticsearch
Json Logging Python
Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver
Stars: ✭ 143 (-1.38%)
Mutual labels:  elasticsearch
Esparser
PHP write SQL to convert DSL to query Elasticsearch
Stars: ✭ 142 (-2.07%)
Mutual labels:  elasticsearch
Nlog.targets.elasticsearch
NLog target for Elasticsearch
Stars: ✭ 137 (-5.52%)
Mutual labels:  elasticsearch

elasticsearch-lua

Build Status Coverage Status

Join the chat at https://gitter.im/DhavalKapil/elasticsearch-lua License

LuaRocks Lua

A low level client for Elasticsearch written in Lua.

In accordance with other official low level clients, the client accepts associative arrays in the form of lua table as parameters.

Features:

  1. One-to-one mapping with REST API and other language clients.
  2. Proper load balancing across all nodes.
  3. Pluggable and multiple connection, selection strategies and connection pool.
  4. Console logging facility.
  5. Almost every parameter is configurable.

Elasticsearch Version Matrix

Elasticsearch Version elasticsearch-lua Branch
>= 2.0, < 5.0 2.x.y

Lua Version Requirements

elasticsearch-lua works for lua >= 5.1 version.

Setup

It can be installed using luarocks

  [sudo] luarocks install elasticsearch

Documentation

The complete documetation is here.

Create elasticsearch client instance:

  local elasticsearch = require "elasticsearch"

  local client = elasticsearch.client{
    hosts = {
      { -- Ignoring any of the following hosts parameters is allowed.
        -- The default shall be set
        protocol = "http",
        host = "localhost",
        port = 9200
      }
    },
    -- Optional parameters
    params = {
      pingTimeout = 2
    }
  }
  -- Will connect to default host/port
  local client = elasticsearch.client()

Full list of params:

  1. pingTimeout : The timeout of a connection for ping and sniff request. Default is 1.
  2. selector : The type of selection strategy to be used. Default is RoundRobinSelector.
  3. connectionPool : The type of connection pool to be used. Default is StaticConnectionPool.
  4. connectionPoolSettings : The connection pool settings,
  5. maxRetryCount : The maximum times to retry if a particular connection fails.
  6. logLevel : The level of logging to be done. Default is warning.

Standard call

local param1, param2 = client:<func>()

param1: Stores the data returned or nil on error

param2: Stores the HTTP status code on success or the error message on failure

Getting info of elasticsearch server

local data, err = client:info()

Index a document

Everything is represented as a lua table.

local data, err = client:index{
  index = "my_index",
  type = "my_type",
  id = "my_doc",
  body = {
    my_key = "my_param"
  }
}

Get a document

data, err = client:get{
  index = "my_index",
  type = "my_type",
  id = "my_doc"
}

Delete a document

data, err = client:delete{
  index = "my_index",
  type = "my_type",
  id = "my_doc"
}

Searching a document

You can search a document using either query string:

data, err = client:search{
  index = "my_index",
  type = "my_type",
  q = "my_key:my_param"
}

Or either a request body:

data, err = client:search{
  index = "my_index",
  type = "my_type",
  body = {
    query = {
      match = {
        my_key = "my_param"
      }
    }
  }
}

Update a document

data, err = client:update{
  index = "my_index",
  type = "my_type",
  id = "my_doc",
  body = {
    doc = {
      my_key = "new_param"
    }
  }
}

Contribution

Feel free to file issues and submit pull requests – contributions are welcome. Please try to follow the code style used in the repository.

License

elasticsearch-lua is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].