środa, 18 czerwca 2025

[Java Spring] Elastic search part 2

 Part before 

Today I add to code other index (collection). I didn`t use easy lib. I use classic search ( with add).

I made similar endpoit -> get all && add. There is base for filter data search.

Intresting thing: Before add element, you can`t get data, beacuse you get exception.

I add mapper too. Golden rule, always get dto, never entity


Commit:

https://github.com/mikoxp/ProgramingRecipes/commit/b5785734a278aab035ed6549e584a74f14ba7cc2

sobota, 14 czerwca 2025

[Java Spring] Elastic search first step



Hello. Today I want to introduction how use elasticsearch with Spring Boot. I thought that other tools to optimization database, but It isn't. 

Elasticsearch is something like object database.

Object database rules

  • download fast[GET], add slow[PUT]
  • only operate on the entire entry
Example ( It is most important)
https://github.com/mikoxp/ProgramingRecipes/commit/12569037e81afd4fbbcabc649df5afbccdd4e0fe

Implementation elastic was simple. I used docker and docker-compose to start elastic.

Api Spring boot. I will be honest. It was boring. Something dependencies and repository similar to relational database.
So it is all. I want try other implementation, but it is next post.