Skip to content

This is sbt project for showing case for querying and sending data to elasticsearch using Akka-http and how to write unit tests.

Notifications You must be signed in to change notification settings

techmonad/akka-http-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

akka-http-elasticsearch

This is sbt project for showing case for querying and sending data to elasticsearch using Akka-http and how to write unit tests.

Getting Started:

Clone and run the unit test:

$ git clone [email protected]:techmonad/akka-http-elasticsearch.git
$ cd  akka-http-elasticsearch
$ sbt test

Elasticsearch Setup

i) Download the Elasticsearch 2.4.4 or latest version and unzip it.

ii) Run the following command.

    $ bin/elasticsearch

Run http server:

  $ sbt run

Test the http rest point using curl:

  1. Add the catalogue record

request:

  $  curl -XPOST 'localhost:9000/catalogue/add'  -d '{"id":1,"type":"book","author":"Martin Odersky","title":"Programming in Scala"}'

response:

 Record added to catalogue successfully
  1. Search by query

request:

$ curl -XPOST 'localhost:9000/catalogue/search' -d '{"author":"martin"}'

response:

 [{"id":2,"type":"book","author":"Martin Odersky","title":"Programming in Scala"}]

About

This is sbt project for showing case for querying and sending data to elasticsearch using Akka-http and how to write unit tests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages