• Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    Java
  • Created over 10 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Demo project showing how to add elasticsearch to a legacy application.

Add Search to Legacy Application

Introduction

This is a demo project to show how to add elasticsearch to a legacy SQL project.

In this branch, you will find the current legacy version of the project.

Installation

You need to have:

  • Maven
  • JDK8 or higher
  • Docker

Run MySQL database using docker with:

./mysql.sh

Build the application:

mvn clean install

Then run it with:

java -jar target/legacy-search-8.0-SNAPSHOT.jar

Or directly run from Maven:

mvn clean spring-boot:run

Note that while developing, you would probably prefer running LegacySearchApp#main() from your IDE to get hot reload of the application.

Play!

Some CRUD operations

# Create one person
curl -XPUT http://127.0.0.1:8080/api/1/person/1 -H "Content-Type: application/json" -d '{"name":"David Pilato"}'

# Read that person
curl http://127.0.0.1:8080/api/1/person/1

# Update full document
curl -XPUT http://127.0.0.1:8080/api/1/person/1 -H "Content-Type: application/json" -d '{"name":"David Pilato", "children":3}'

# Check
curl http://127.0.0.1:8080/api/1/person/1

# Delete
curl -XDELETE http://127.0.0.1:8080/api/1/person/1

# Check (you should get a 404 error)
curl http://127.0.0.1:8080/api/1/person/1

Database Initialisation

# Initialize the database with 1 000 (default) or 10 000 persons
curl http://127.0.0.1:8080/api/1/person/_init
curl http://127.0.0.1:8080/api/1/person/_init?size=10000

Search

# Search for something (`a la google`)
curl "http://127.0.0.1:8080/api/1/person/_search?q=Joe"

You can then access the application using your browser: http://127.0.0.1:8080/. You can also look at advanced search.

Next step

Look at branch 01-direct

More Repositories

1

fscrawler

Elasticsearch File System Crawler (FS Crawler)
Java
1,330
star
2

spring-elasticsearch

Spring factories for elasticsearch
Java
288
star
3

rssriver

Elasticsearch Rss River (PROJECT STOPPED)
Java
90
star
4

elasticsearch-beyonder

Elasticsearch Beyonder project gives some features beyond elasticsearch itself.
Java
49
star
5

testcontainers-java-module-elasticsearch

Dockerized Elasticsearch container for testing under Testcontainers
Java
23
star
6

hsearch-es-demo

Hibernate Search and Elasticsearch demo
Java
21
star
7

dropbox

Dropbox River for Elasticsearch (PROJECT STOPPED)
Java
19
star
8

sql2nosql

Demo project for talks about migrating from SQL to NoSQL
Java
17
star
9

es-hibernate-connector

Make your Hibernate Search more Elastic ! WARNING : project suspended !
Java
17
star
10

elasticsearch-java-client-demo

Elasticsearch Client Java Sample project
Java
17
star
11

devoxxfr_demo

Twitter Demo for Devoxx France (Deprecated)
CSS
15
star
12

bano-elastic

Demo repo on how to use Bano with elastic to do data enrichment
Shell
10
star
13

spore-elasticsearch

SPORE specifications for elasticsearch
Java
8
star
14

elasticsearch-integration-tests

Demo project for elasticsearch integration testing with Docker
Java
6
star
15

injector

This injector is used to demo elasticsearch and Kibana.
Java
6
star
16

soundbeat

Soundbeat for beats
Go
5
star
17

elasticsearch-mapper-demo

Mapper Demo Plugin for Elasticsearch
4
star
18

S01E05-index-split-shrink-rollover

Demo scripts used for Elastic Daily Bytes - Index Split, Shrink and Rollover
Shell
4
star
19

spring-boot-cloud-elastic

Shell
4
star
20

demo-automatic-doc

Demo project for automatic documentation using Github Actions
Java
3
star
21

shaded-test

Elasticsearch shading test
Java
2
star
22

fslocalriver

Don't use it !
Java
2
star
23

dadoonet.github.io

Personal website (powered by Hugo)
HTML
1
star
24

esmavenplugin-test

Testing project for esmavenplugin
Java
1
star
25

esjqueryplugin

JQuery Plugins for Elastic Search
1
star
26

devoxx2012

Devoxx 2012 Tweet analysis with elasticsearch
JavaScript
1
star
27

esriver

ElasticSearch River for ElasticSearch
1
star
28

elasticsearch-httpclient

Java
1
star
29

S01E14-searchable-snapshots

Demo scripts used for Elastic Daily Bytes - (Searchable) Snapshots
Shell
1
star
30

www.pilato.fr

HTML
1
star
31

DevoxxFR-2023

Shell
1
star
32

oldtalks

Some public talks
JavaScript
1
star
33

S01E02-index-templates-v2

Demo scripts used for Elastic Daily Bytes - Index Templates V2
Shell
1
star
34

S01E07-reindex-aliases

Demo scripts used for Elastic Daily Bytes - Aliases and Reindex
Shell
1
star
35

try_git

1
star
36

S01E10-ingest-processors

Demo scripts used for Elastic Daily Bytes - Ingest Processors
Shell
1
star
37

discuss-api

Shell
1
star
38

S01E12-text-analysis

Demo scripts used for Elastic Daily Bytes - Text Analysis
Shell
1
star
39

s02e11-ingest

Demo scripts used for Elastic Daily Bytes - Kibana Ingest Management
Shell
1
star