Talent-Catalog / talentcatalog

https://tctalent.org
GNU Affero General Public License v3.0
13 stars 4 forks source link

Write new version of Elasticsearch interface #1619

Open camerojo opened 3 hours ago

camerojo commented 3 hours ago

Spring Boot 3 no longer supports the high level REST interface: RestHighLevelClient - which is what we currently use.

See https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#elasticsearch-clients-and-templates

camerojo commented 3 hours ago

See https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#elasticsearch-clients-and-templates

The options are described here: https://docs.spring.io/spring-boot/docs/3.0.x/reference/html/data.html#data.nosql.elasticsearch

The official low level client is VERY low level - down at HTTP level - working through a generic RestClient bean.

The Java API is fairly straight forward - mapping on to the basic JSON queries

The Spring data version can take JSON string queries directly (it also supports Criteria queries which we don't like, plus a Java query object and builders). It is built on top of the JavaAPI client - which in turn is built on top of the low level REST client.

@ajt001 Started work on the Java API.

Moving to the new Spring Data client is probablt the fastest way to convert - see the conversion notes below. We still have access to the JavaAPI so we get the best of both worlds.

Spring guide to converting to new Spring Data Elasticsearch version

https://docs.spring.io/spring-data/elasticsearch/reference/migration-guides/migration-guide-4.4-5.0.html

camerojo commented 1 hour ago