Giter Club home page Giter Club logo

bank-query-es's Introduction

Elastic search query DSL (Bank example)

I came across Bloodhound and ES Bank Example. Which coupled with my intrest in DSL's, compilers led to this project. A query DSL for the bank example. This can probably even be useful example to some. Given my super beginner understanding of haskell the code base could be painful to read but hopefully that will improve.

Usage

  • Run elasticsearch. Load up the bank data. (on localhost:9200)
  • Run stack build.
  • Run stack exec app-search-exe. (Now the app is running)
  • App will run on port 8081
  • You can now execute queries on it like curl -XGET -G http://localhost:8081/search -d 'query=gender:F'

Query syntax

  • You can use gender, age, balance, and, or.

Examples

  • query=(balance%20%20>48000)%20and%20age<=24%20and%20gender:F
  • query=(balance%20%20<48000)%20or%20age<=24%20and%20gender:F
  • and so on

Note

  • Config is being handled in the most naive way (Need to look into how to stack monads)
  • See src/Utils.hs to see what can be configured

Config

Env Var Desc Default
SCOTTY_PORT port 8081
ES_USERNAME elasticsearch username -
ES_PASSWORD elasticsearch password -
ES_URL elasticsearch url localhost
ES_PORT elasticsearch port 9200
ES_INDEX elasticsearch index bank
KEY_MAP* key mapping file path -
FILTER_MAP* filter mapping file path -

* - multiline files seperated with spaces (txt) e.g. filters.txt

c ct
nam user org
addr address

bank-query-es's People

Contributors

nixypanda avatar

Stargazers

Felx avatar Narendra Joshi avatar Daniel Kahlenberg avatar

Watchers

James Cloos avatar  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.