Skip to content

kikei/actix-with-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

actix-with-elasticsearch

Simple application for testing actix with elasticsearch

I made this web application for preliminary survey of actix-web and elasticsearch with japanese full-text search.

For more information, check below link:

https://kikei.github.io/rust/2020/05/13/actixweb-elasticsearch.html

How to

You can launch app by just running docker-compose.

docker-compose up -d

APIs

Craete new document:

curl -XPUT -H "Content-Type: application/json" --data \
  '{ "name": "西多賀旅館", "address": "宮城県大崎市鳴子温泉新屋敷78-3", "area": "鳴子温泉" }' \
   http://localhost:8080/onsen/

Get document by id:

url http://localhost:8080/onsen/umbINHIB3Vl9TKW-8SVx

Update a document with id:

curl -XPOST -H "Content-Type: application/json" --data \
  '{ "id": "umbINHIB3Vl9TKW-8SVx", "name": "西多賀旅館 東北宮城の湯治宿", "address": "宮城県大崎市鳴子温泉新屋敷78-3", "area": "鳴子温泉" }' http://localhost:8080/onsen/umbINHIB3Vl9TKW-8SVx

Delete a document by id:

curl -XDELETE http://localhost:8080/onsen/umbINHIB3Vl9TKW-8SVx

List all documents:

curl http://localhost:8080/onsen

Search document by query:

curl "http://localhost:8080/onsen/?query=%E6%B8%A9%E6%B3%89"

About

Simple application for testing actix with elasticsearch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published