Feature/ implement basic search function #40

Merged
kasun merged 30 commits from feature/Implement-basic-search-function into main 2026-06-25 17:58:40 +02:00
5 changed files with 41 additions and 28 deletions
Showing only changes of commit a542d23c00 - Show all commits
+2 -2
View File
@@ -1,6 +1,6 @@
plugins { plugins {
java java
id("org.springframework.boot") version "4.0.6" id("org.springframework.boot") version "4.1.0"
id("io.spring.dependency-management") version "1.1.7" id("io.spring.dependency-management") version "1.1.7"
} }
@@ -23,7 +23,7 @@ repositories {
mavenCentral() mavenCentral()
} }
extra["springAiVersion"] = "2.0.0-M3" extra["springAiVersion"] = "2.0.0"
dependencies { dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa") implementation("org.springframework.boot:spring-boot-starter-data-jpa")
@@ -1,9 +1,7 @@
package com.vaessl.app.connection; package com.vaessl.app.connection;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ConnectionRepository extends JpaRepository<ConnectionEntity, Long> { public interface ConnectionRepository extends JpaRepository<ConnectionEntity, Long> {
ConnectionEntity findByAppUrlAndUsername(String appUrl, String username); ConnectionEntity findByAppUrlAndUsername(String appUrl, String username);
@@ -6,4 +6,4 @@ spring:
driver-class-name: ${PG_DRIVER_CLASS_NAME} driver-class-name: ${PG_DRIVER_CLASS_NAME}
jpa: jpa:
hibernate: hibernate:
ddl-auto: create-drop ddl-auto: update
@@ -36,8 +36,6 @@ Now deploy the docker-compose and check all the configurations:
``` ```
java --version java --version
mvn --version
npm --version npm --version
yarn --version
nodejs --version nodejs --version
``` ```
@@ -1,4 +1,4 @@
**Vaessl: Spring Boot setup** **Vaessl: Spring Boot and database setup**
This app will use the current latest version 4.0.4 of Spring Boot and the latest OpenJDK 25 LTS. This app will use the current latest version 4.0.4 of Spring Boot and the latest OpenJDK 25 LTS.
@@ -138,7 +138,7 @@ spring:
``` ```
Note that I'm using my own locally hosted PostgreSQL instances for the main and test database. The Docker Compose file will look something like this: The Docker Compose file for code-server will look something like this:
``` ```
--- ---
@@ -163,26 +163,43 @@ services:
- 8124:8080 - 8124:8080
- 5173:5173 - 5173:5173
restart: unless-stopped restart: unless-stopped
```
vaessl-db: Note that I'm using my own locally hosted PostgreSQL instances for the main and test database. Just add databases via SQL or PgAdmin and install the pgvector extension to each database manually. There is an offical ready-made pgvector docker image but if you already host a PostGreSQL database you need to add the extension yourself.
image: pgvector/pgvector:pg18
container_name: vaessl-db
environment:
- POSTGRES_DB=vaessl
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pw
ports:
- 5433:5432
vassal-test-db: Check the name of your PostGreSQL container:
image: pgvector/pgvector:pg18 ```
container_name: vassal-test-db docker ps
environment: ```
- POSTGRES_DB=vassal_test
- POSTGRES_USER=user Enter your container via bash:
- POSTGRES_PASSWORD=pw
ports: ```
- 5434:5432 docker exec -it 876fb382969f bash
```
Before working on your database backup your databases:
```
su - postgres -c "pg_dumpall > /tmp/backup200526.sql"
#exit the container and copy the backup file to local file system
docker cp 876fb382969f:/tmp/backup200526.sql .
```
Install dependencies, build and install pgvector:
apt-get update
apt-get install -y build-essential git postgresql-server-dev-all
```
git clone https://github.com/pgvector/pgvector.git
cd pgvector
make
make install
docker restart 876fb382969f
```
Enter PostGreSQL container and create pgvector extension for each databse:
```
docker exec -it <container-name> psql -h localhost -U <db-user> -d <db-name>
CREATE EXTENSION vector;
``` ```
# Appendix: Additional config for developing in Code-Server # Appendix: Additional config for developing in Code-Server