![kanezi](/img/default-banner.jpg)
- 25
- 66 324
kanezi
เข้าร่วมเมื่อ 30 ม.ค. 2023
Enterprise full stack development
Postgres Full Text Search
Video explores PostgreSQL full text search capabilities, creating and indexing text documents and providing search capabilities.
Postgres introduces two new datatypes to support full test search, tsvector and tsquery.
Tsvector represents document in form suitable for searching and tsquery a predicate that documents you’re searching on needs to satisfy.
Postgres also supports misspelling suggestions with pg_trgm trigram extension and synonyms searches by dictionary and search configuration extension.
To make you searches performant we’ll use indexes on search columns.
Finally, we demonstrate search concepts in action on java spring boot demo web app.
github link:
github.com/kanezi/postgres-fts
00:00 - intro
00:27 - full text search
01:45 - lucene index & search
02:16 - sample pg project
03:56 - pg regular text search operators
06:14 - pg full text search parts
07:27 - tsvector
09:30 - stop words
11:02 - unnacent
11:30 - parsing and translating
12:48 - tsquery
14:49 - @@ operator
16:00 - || && operators
16:59 - ranking
18:59 - ts_headline
19:44 - synonyms
21:00 - indexing
25:50 - select for web ui
27:14 - synonyms
30:49 - java spring app example
32:48 - outro
Postgres introduces two new datatypes to support full test search, tsvector and tsquery.
Tsvector represents document in form suitable for searching and tsquery a predicate that documents you’re searching on needs to satisfy.
Postgres also supports misspelling suggestions with pg_trgm trigram extension and synonyms searches by dictionary and search configuration extension.
To make you searches performant we’ll use indexes on search columns.
Finally, we demonstrate search concepts in action on java spring boot demo web app.
github link:
github.com/kanezi/postgres-fts
00:00 - intro
00:27 - full text search
01:45 - lucene index & search
02:16 - sample pg project
03:56 - pg regular text search operators
06:14 - pg full text search parts
07:27 - tsvector
09:30 - stop words
11:02 - unnacent
11:30 - parsing and translating
12:48 - tsquery
14:49 - @@ operator
16:00 - || && operators
16:59 - ranking
18:59 - ts_headline
19:44 - synonyms
21:00 - indexing
25:50 - select for web ui
27:14 - synonyms
30:49 - java spring app example
32:48 - outro
มุมมอง: 3 509
วีดีโอ
understand Database A.C.I.D. so you don't get burned
มุมมอง 1229 หลายเดือนก่อน
ACID, in computer science is a set of properties of database transactions intended to provide safety guarantees needed for business data processing, typical use case being financial transaction processing, where the transaction term was borrowed from. Each letter in a well known acronym ACID, which stands for Atomicity, Consistency, Isolation, Durability represents four major guarantees of the ...
Oauth2 and Oidc for JavaScript SPAs | via Google and GitLab
มุมมอง 3209 หลายเดือนก่อน
We'll explore details of oauth2 and open id protocols for JavaScript Single Page Applications (SPAs). We'll see what problems do they solve and what is their purpose. We'll explain different types of tokens exchanged in the protocols, access, id, refresh tokes and explore their format. Specifically we'll go into detail about JWT JSON web token format for id tokens (and sometimes access tokens)....
Deploy apps to Clever Cloud | Docker | Spring | PostgreSQL | Redis | S3
มุมมอง 1.1K11 หลายเดือนก่อน
Clever cloud is hosting provider that supports various runtime environments, like node, java, ruby, as well as host of add-ons including relational databases, like PostgreSQL, Redis in memory store, cellar (amazon s3 compatible file storage service), etc. We'll deploy two apps to clever cloud and show how to incorporate deployment into GitHub ci/cd workflow environment. First app will be spring...
Host apps on Render.com | spring | docker | postgres | redis
มุมมอง 9K11 หลายเดือนก่อน
We'll demonstrate how to use cloud provider render.com to host java spring apps, postgres database and Redis in-memory key value store. Although java runtime and spring apps are not supported directly, render gives ability to create web services based on docker images. We'll show how to use hooks to automate deployment and blueprints to automatically provision and connect related services. We'l...
GitHub actions for Java CI automation
มุมมอง 64911 หลายเดือนก่อน
GitHub actions is automation feature of GitHub platform enabling CI/CD and other automation workflows. In this video we showcase various features of GitHub actions. We implement CI pipelines that publish package to GitHub Maven package registry. We also implement workflow that creates Docker image from Java Spring application and publishes image to Docker Hub and GitHub Container registry. Grad...
JVM project versioning with JGitVer
มุมมอง 317ปีที่แล้ว
How to version JVM platform projects that use Maven or Gradle as build tool and Git version control using JGitVer set of plugins and library. 00:00 - intro 00:32 - git history polution 01:25 - version collision 03:42 - what is jgitver 04:38 - maven example 08:57 - maven vs gradle version naming 11:29 - outro
GitLab CI/CD - Deep Dive
มุมมอง 1.1Kปีที่แล้ว
Deep dive into GitLab platform ci/cd features. We explore what CI/CD is. What continuous integration is and what is the difference between continuous delivery and continuous deployment. What does the architecture of GitLab platform look like and what is the role of gitlab-runners? How does GitLab compares to GitHub and Jenkins? We'll go through series of examples where we push artifact to gitla...
Monitoring and Metrics for Spring | with Prometheus - Grafana - Actuator
มุมมอง 10Kปีที่แล้ว
A look at how to provide meta data about spring boot application using actuator library. How to expose metrics for web app using Micrometer facade library. How to use Prometheus system monitoring tool to pull data from java spring web application. How to scrape data from Postgres database using postgres exporter. How to visualize gathered data with Grafana visualization tool using graphs and da...
ChatGPT - AI assistant for developers
มุมมอง 56ปีที่แล้ว
A look at how ChatGpt, AI chatbot from OpenAI, can help with answering programming questions. Where it shines and where i breaks down...
UI test automation
มุมมอง 264ปีที่แล้ว
How do we test web UI in our spring Web applications? We need test automation tools that can record and repeat given steps. In this video we'll present selenium automation framework and it's surrounding infrastructure. To test our spring project we'll use Selenide testing library build on top of Selenium. To enable testing in Gui-less CI/CD environments we'll integrate our UI tests with Testcon...
Testing pyramid in Spring Web apps | Unit - Integration - Functional - e2e
มุมมอง 377ปีที่แล้ว
Different types of test explained on the example of java Spring web application. What is the purpose and how to create unit, integration, functional and e2e (end to end) tests using spring provided testing facilities. 00:00 - intro 02:29 - first unit test 05:02 - service unit test 10:55 - integration tests 15:23 - Controllers 19:52 - Sign up integration test 26:47 - functional and e2e tests 28:...
Spring boot starter testing toolkit explained
มุมมอง 469ปีที่แล้ว
We'll explore 4 basic testing libraries included by default with every spring boot project: Junit5, AssertJ, hamcret and mockito. We'll discuss their role in spring testing ecosystem, connection with build tools/IDE's and look at usage examples. 00:00 - intro 00:26 - Junit5 04:05 - hamcrest and AssertJ 09:57 - build tools 11:26 - Junit Jupiter extension model 12:39 - mockito 17:06 - outro
DataBase testing with Testcontainers | use Production DB in Spring tests
มุมมอง 498ปีที่แล้ว
How to use Testcontainers library in java spring apps during tests to spin up database infrastructure identical to our production? How do we make sure our test are isolated and don't interfere with each other? How do we load test data for our tests? Github repo: github.com/kanezi/spring-social-2-cloud 00:00 - intro 02:10 - testcontainer dependencies 03:19 - @DataJpaTest 05:36 - @Testcontainers ...
Data Persistence in Spring Apps | provision PostgreSQL DB locally via Docker and in Cloud
มุมมอง 617ปีที่แล้ว
Part 6 of spring social 2 cloud series. In this part we'll add relational database support, connect our app to PostgreSQL database and persist our user. We'll use docker to spin up local instance of database. We'll provision PostgreSQL database with our cloud provider railway.app and connect our deployed app to provisioned database. We'll explore ORM - Object relational features of JPA - Jakart...
CI/CD for database - 2 devops tools for DB versioning and migration | liquibase and flyway
มุมมอง 9Kปีที่แล้ว
CI/CD for database - 2 devops tools for DB versioning and migration | liquibase and flyway
How to reduce Java verbosity and boilerplate | using lombok and records
มุมมอง 193ปีที่แล้ว
How to reduce Java verbosity and boilerplate | using lombok and records
Exploring The Backstory of Reactive UI vs Blocking WEB
มุมมอง 263ปีที่แล้ว
Exploring The Backstory of Reactive UI vs Blocking WEB
The Beginner's Guide To Spring Relational Data Support
มุมมอง 189ปีที่แล้ว
The Beginner's Guide To Spring Relational Data Support
Form submission and validation in Spring MVC
มุมมอง 1Kปีที่แล้ว
Form submission and validation in Spring MVC
Customizing login experience in Spring MVC web apps
มุมมอง 4.9Kปีที่แล้ว
Customizing login experience in Spring MVC web apps
up to speed with Thymeleaf in 1 hour | for spring mvc web apps
มุมมอง 950ปีที่แล้ว
up to speed with Thymeleaf in 1 hour | for spring mvc web apps
OAuth2 client sign in for Spring web apps | via Google and Github
มุมมอง 17Kปีที่แล้ว
OAuth2 client sign in for Spring web apps | via Google and Github
Spring security architecture overview | for web apps
มุมมอง 1.9Kปีที่แล้ว
Spring security architecture overview | for web apps
Deploy spring web apps to cloud | using Railway.app
มุมมอง 2.6Kปีที่แล้ว
Deploy spring web apps to cloud | using Railway.app
fantastic video! It will be nice to see a practical project built with this.. like searching pdf content or a library.. etc
If I could give you more than one of both thumbs ups and github stars, I would. Epic.
much appreciated!!!
Explained very well for a quick difference between the two and how they are used. Thank you.
Great content, thorough and well delivered. Subscribed.
I'm glad it was helpful
Amazing contect I will try it later
mysql ??
mysql is available as reneder disk: docs.render.com/deploy-mysql For postgres reneder offers more out of the box features, like backup and recovery
Thanks ! I already connected the application to postgres, it was easier that way@@kanezi
hi sir, i'm having a probem with: alter table book add column fts_doc tsvector generated always as ( setweight(to_tsvector('english', title), 'A') || setweight(to_tsvector('simple', description), 'A') ) stored; =>> And the fts_doc result is: "''educational':6A 'ending':5A 'happy':4A 'motivation':3A 'strong':2A" but i think it should be "'educ':6A 'end':5A 'happi':4A'motiv':3A 'strong':2A" => This result comes from: select setweight(to_tsvector('Be Strong, Motivation, Happy Ending, Educational'), 'A') Why is it? Is there anything wrong that makes the diffrence?
in your fts_doc column part "to_tsvector('simple', description)" uses "simple" configuration that leaves the words as is, and just tokenizes description. Try using to_tsvector('english', description) instead.
Great content ever seen before which covers a lot of things. Thanks a lot @Kanezi. Need some info as I am having one doubt for JWT token based authentication. For example I am having Employee Login and Logout functionality with create and update as well. I am using Thymeleaf as UI. I want to apply JWT based authentication for these end points. I am having filter class where checking the AuthHeader and Bearer token from each request. But how to send the Authorization header from any request to controller from thymeleaf pages, so that it will pass through filter and filter will validate and authenticate each request and save authentication Object in Security Context. Please suggest any thoughts.
So much information that I looking for, found it hear thank y so much. Just one question Sir. iam nw with docker and docker hub compose and all of these things. I have a Spring Boot app that connect to Postgres DB . how can I create ONE image and push it to docker hub so that wann i pull it and run it . Will Work. (I hope that y understand what I want to do).
you want postgres and spring boot app in one docker image? It can be done by building an image with all necessary software installed, but it's not a recommended docker way. Docker way are atomic images that you can combine with other services, so one image for database and another for your spring app. You can user docker compose to spin up both containers and run them with one command. I might do a video on the topic to explain it better
yes, it would help me a lot, thank y so much. All the TH-cam videos explains how to create this just locally but now one explain how to push the two images (for Continues integration) to docker hub and after pull them still can connect two each other. As i already said am new with Docker so I hope my Question is not stupid. i Just want to push all these things to docker hub and pull it from other machine and run it@@kanezi
@@abidiabdelbaset1920if you want to know how to create and push images to docker hub or other registries for ci, have a look at my github and gitlab ci/cd videos - playlist: th-cam.com/play/PLLhgRnf2WBVQxHnSEGPEh9h5lppcMrNw_.html
Very professional video, really helps!!
great content, thanks for your effort.
Thanks man!
In your java spring app example, the search-word is "albert -einstein life" and the result does not match the whole search-word (without the word " -einstein"). Can you please answer why the app still gives back search result? I am having problems with search-word from users that does not have in the tsvector-column (in this case, my app will show zero result). Thank you!
is your question why search: "albert -einstein life" on the beginning of tutorial gives results? Why do I get results Albert + life, but also only Albert and only life?
Thanks for your reply. Yes, that is my question, my Postgres FTS only gives results if all the search words are in ts_vector. What i want is to still recieve results even if there are some missing keywords like your example (2/3 searchword not 3/3). Thanks.
how are you searching on ts_vector column / converting to ts_query? In my case I'm using "document@@ websearch_to_tsquery(:q)". I'm using postgres build in function "websearch_to_tsquery" to convert user input to ts_query. Have a look at repository in video description for query example - FtsDocumentRepository class.
Very informative and helpful, Thankyou for detailed explanation.
Thank you for a great job!
Such an in-depth explanation, very informative, keep it up, sir!
thanks for comprehensive guide
thanks for sharing
Really well explained!
hey great tutorial. Could you please extend this tutorial with react where user can login using frontend (user/email, google and github) and the backend is protect by spring oath 2. In the whole internet, i can not find that easily. most of them either fronetend only or backend only.
Awesome! Can I follow your tutorial using Eclipse IDE and MySQL as the database manager?
yes, you can use eclipse! railway also supports MySql, so yes, you can use MySql. You'll need to change database url and docker compose database service to use MySql in development as well.
This video is a game-changer for me! I appreciate the effort you put into breaking down complex topics into easily digestible information. 😊 Keep up the fantastic work!
very kind words! thank you!
great in depth gitlab tutorial, thank you
Many thanks for your help to us. Gratitudes!!!
This video is indeed a great start to learn the spring security. I've watched plenty of videos available on TH-cam. But not a single video makes much sense to me, and somehow, I lost my track somewhere in between and didn't completed any one of it. Here, you'll get the chance to see the architecture and a small implementation of it as well. And when explaining architecture, you'll see that the author takes you to the direct source, which is spring security docs. Explain the architectural diagram and then sum up the session by doing a small debug session and relate it to the architectural diagram. I'm so glad to found this great channel. And looking forward for the more amazing content here. Thanks a lot, Kanezi.
I'm glad video was helpful and, of course, glad you found the channel!
Signoz does traces logs metrics
This was an intuitive demonstration. Thank you ❤❤
Man, this is a treasure! please keep doing more advanced stuff like this!
thanks, I'll try! I'm also open for topic suggestions...
Your videos are great! Thank you very much!
Thanks for such insightful content. Real enterprise grade stuff. Gratitudes!!!
Glad you find it helpful!
Amazing video, explained everything step by step slowly.
could you make a video where you connect OAuth2 with springboot as backend and then use like react only as frontend, and use REST api call to login trough the springboot backend which communicates with OAUTH2.
yes, I have plans to publish spring boot backend + angular/vue/react frontends tutorials. hopefully I'll get them out this year...
Thanks you!
Hi Kanezi, My frontend and backend are on different ports, spring boot 3.1.0 using for backend. can you please explain how to configure spring security for google oauth and normal login.
yes, I will in near future! In the meantime, I suggest you take a look at keycloak single sign-on open source server. You can configure normal and google login with keycloak, and they have frontend and backend libraries you can integrate with
Hello is it possible to store files/folders (server) in a multiuser app so that only users with certain roles or only the owner can access it read/modify after. How to do this in springboot. A similar project would help me but I can't find any on github. Can you help me?
yes it's possible, I can create a small example for you, but what are you having trouble with? a) how to secure a method? b) how to store files? For a) most simple way is that you injecting user into read / modify methods with (@AuthenticationPrincipal User user) and then check in method that login in user created the file before you proceed. Alternative is to annotate your method with @PreAuthorize and declaratively specify restrictions: i.e. with this annotations only admins can modify @PreAuthorize("hasAuthority('admin')") For b) where do you need to store files? You can store them as blob's in database, in s3 buckets, etc..
yes sir an example would greatly help me and to answer your question.Well its b and i think blob's in database is more in line with my level in spring framework as of now.thank you @@kanezi
Thank you for a clear overview of these components. Very helpful.
U r the best!
😉 *PromoSM*
Thank you @Kanezi for the awesome videos. I am having issue, i am not able to connect to postgre db using DBeaver application, I followed all the steps as illustrated in this video, when i try testing the connection, i get 'FATAL: password authentication failed for user "user"'
Hard to say what went wrong, could be multiple things... Maybe database wasn't started properly? Did you start docker services with "docker compose up"? (you can find docker-compose.yml in the root of git project) Can you verify that docker started postgres container?
Awesome! Thanks for your top-notch videos.
Glad you like them!
very good content mate. Thank you for sharing. U gained a sub! cheers from south america !
thank you! welcome to our familia!
❤
Excellent explanation
Amazing content
Why everyone is making tutorials of socal login with thymeleaf and static spring resources WTF.. 2023 and I cant find tutorial for regular Spring rest api social login
I got you, java backend rest social login + js frontend tutorials will be on the channel in 2023! I plan to showcase more features, like password reset so it's more involved to do
Just found out about your videos. Amazing work, thank you.
thanks for the kind words! glad you like them!
Wow. I discovered this channel today. I'm yet to take my first app to production but im learning a lot already.
Welcome aboard! It so fulfilling to help someone! By creating these videos, I learned a lot too!
Very good video, can you make a video of your liquibase installation? I had problems installing on my ubuntu 22.04
did you go with steps in their official installation guide? docs.liquibase.com/start/install/liquibase-linux.html they have Troubleshooting part as well: docs.liquibase.com/start/install/liquibase-installation-troubleshooting.html
@@kanezi yes the same but I get an error that it can't find the postgresql jar in the temporary folder
liquibase installation should come with postgresql.jar driver in liquibase/internal/lib if it's not there, try to download postgres driver from: jdbc.postgresql.org/download/ and put it into liquibase/lib folder. Also check your liquibase.properties file in your project. You can set "classpath" key to point to database jar - maybe it points to non existing temporary folder?
Great video! ❤ Looking forward to more tutorials from you!
You are one of the best Java channels on TH-cam for anyone building production grade applications. I really appreciate your content.
thank you! support like this motivates me to continue producing content!