Skip to content

m-jayson/SpringBoot-Elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steps to run

  • Run the Elastic docker compose - docker-compose up in the parent directory where the docker-compose.yaml is located.
  • Once the service is running, run the spring boot project - mvnw.cmd clean compile spring-boot:run

Rest API Endpoints

  • GET ALL Persons curl --location --request GET 'localhost:8080/demo'

  • POST (Upsert) Persons

to insert (upsert)

curl --location --request POST 'localhost:8080/demo/upsert' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstname" : "testfirstname123",
    "lastname" : "lastname123",
    "middlename": "middle123"
}'

to update (upsert)

curl --location --request POST 'localhost:8080/demo/upsert' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "rYa9QIABGZ-Aiirr3lPR",
    "firstname" : "testfirstname123",
    "lastname" : "lastname123",
    "middlename": "middle123"
}'

If the id is not null/empty then update will be executed, else insert

About

Spring Boot and Elasticsearch project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages